Namespace: Tiled

Phaser.Tilemaps.Parsers. Tiled

Methods


<static> AssignTileProperties(mapData)

Copy properties from tileset to tiles.

Parameters:
Name Type Description
mapData Phaser.Tilemaps.MapData

[description]

Since: 3.0.0
Source: src/tilemaps/parsers/tiled/AssignTileProperties.js (Line 9)

<static> Base64Decode(data)

Decode base-64 encoded data, for example as exported by Tiled.

Parameters:
Name Type Description
data object

Base-64 encoded data to decode.

Since: 3.0.0
Source: src/tilemaps/parsers/tiled/Base64Decode.js (Line 7)
Returns:

Array containing the decoded bytes.

Type
array

<static> BuildTilesetIndex(mapData)

Master list of tiles -> x, y, index in tileset.

Parameters:
Name Type Description
mapData Phaser.Tilemaps.MapData

[description]

Since: 3.0.0
Source: src/tilemaps/parsers/tiled/BuildTilesetIndex.js (Line 7)
Returns:

[description]

Type
array

<static> ParseGID(gid)

See Tiled documentation on tile flipping:
http://docs.mapeditor.org/en/latest/reference/tmx-map-format/

Parameters:
Name Type Description
gid number

[description]

Since: 3.0.0
Source: src/tilemaps/parsers/tiled/ParseGID.js (Line 11)
Returns:

[description]

Type
object

<static> ParseImageLayers(json)

[description]

Parameters:
Name Type Description
json object

[description]

Since: 3.0.0
Source: src/tilemaps/parsers/tiled/ParseImageLayers.js (Line 9)
Returns:

[description]

Type
array

<static> ParseJSONTiled(name, json, insertNull)

Parses a Tiled JSON object into a new MapData object.

Parameters:
Name Type Description
name string

The name of the tilemap, used to set the name on the MapData.

json object

The Tiled JSON object.

insertNull boolean

Controls how empty tiles, tiles with an index of -1, in the map
data are handled. If true, empty locations will get a value of null. If false, empty
location will get a Tile object with an index of -1. If you've a large sparsely populated map and
the tile data doesn't need to change then setting this value to true will help with memory
consumption. However if your map is small or you need to update the tiles dynamically, then leave
the default value set.

Since: 3.0.0
Source: src/tilemaps/parsers/tiled/ParseJSONTiled.js (Line 20)
Returns:

The created MapData object, or null if the data can't be parsed.

Type
Phaser.Tilemaps.MapData

<static> ParseObject(tiledObject [, offsetX] [, offsetY])

[description]

Parameters:
Name Type Argument Default Description
tiledObject object

[description]

offsetX number <optional>
0

[description]

offsetY number <optional>
0

[description]

Since: 3.0.0
Source: src/tilemaps/parsers/tiled/ParseObject.js (Line 14)
Returns:

[description]

Type
object

<static> ParseObjectLayers(json)

[description]

Parameters:
Name Type Description
json object

[description]

Since: 3.0.0
Source: src/tilemaps/parsers/tiled/ParseObjectLayers.js (Line 11)
Returns:

[description]

Type
array

<static> ParseTileLayers(json, insertNull)

[description]

Parameters:
Name Type Description
json object

[description]

insertNull boolean

[description]

Since: 3.0.0
Source: src/tilemaps/parsers/tiled/ParseTileLayers.js (Line 13)
Returns:

[description]

Type
array

<static> ParseTilesets(json)

Tilesets & Image Collections

Parameters:
Name Type Description
json object

[description]

Since: 3.0.0
Source: src/tilemaps/parsers/tiled/ParseTilesets.js (Line 11)
Returns:

[description]

Type
object

<static> Pick(object, keys)

[description]

Parameters:
Name Type Description
object object

[description]

keys array

[description]

Since: 3.0.0
Source: src/tilemaps/parsers/tiled/Pick.js (Line 9)
Returns:

[description]

Type
object