TMXUtils

namespace TMXUtils

a collection of utility functions for parsing TMX maps

Summary


Public Methods


applyTMXProperties TMXUtils.js:375
applyTMXProperties(obj: object, data: object) → {object}

Apply TMX Properties to the given object

Parameters:
Name Type Description
obj object

object to apply the properties to

data object

TMX data object

Returns:
Type Description
object

obj

decode TMXUtils.js:301
decode(data: string, encoding: string) → {Array<number>}

Decode a encoded array into a binary array

Parameters:
Name Type Attributes Default Description
data string

data to be decoded

encoding string

<optional>

"none"

data encoding ("csv", "base64", "xml")

Returns:
Type Description
Array<number>

Decoded data

decodeBase64AsArray TMXUtils.js:272
decodeBase64AsArray(input: string, bytes: number) → {Uint32Array}

Decode a base64 encoded string into a byte array

Parameters:
Name Type Attributes Default Description
input string

Base64 encoded data

bytes number

<optional>

1

number of bytes per array entry

Returns:
Type Description
Uint32Array

Decoded data

decodeCSV TMXUtils.js:256
decodeCSV(input-: string) → {Array<number>}

Decode a CSV encoded array into a binary array

Parameters:
Name Type Description
input- string

CSV formatted data (only numbers, everything else will be converted to NaN)

Returns:
Type Description
Array<number>

Decoded data

decompress TMXUtils.js:241
decompress(input: string, format: string) → {Uint32Array}

decompress and decode zlib/gzip data

Parameters:
Name Type Description
input string

Base64 encoded and compressed data

format string

compressed data format ("gzip","zlib", "zstd")

Returns:
Type Description
Uint32Array

Decoded and decompress data

parse TMXUtils.js:335
parse(xml: Document) → {object}

Parse a XML TMX object and returns the corresponding javascript object

Parameters:
Name Type Description
xml Document

XML TMX object

Returns:
Type Description
object

Javascript object

setInflateFunction TMXUtils.js:292
setInflateFunction(fn: Func) → {}

set the function used to inflate gzip/zlib data

Parameters:
Name Type Description
fn Func

inflate function


Powered by webdoc!