Skip to main content
Version: Phaser v4.0.0

Phaser.Tilemaps.Parsers.Impact

Scope: static

Source: src/tilemaps/parsers/impact/index.js#L7

Static functions

ParseTileLayers

<static> ParseTileLayers(json, insertNull)

Description:

Parses all tilemap layers in an Impact JSON object into new LayerData objects.

Parameters:

nametypeoptionaldescription
jsonobjectNoThe Impact JSON object.
insertNullbooleanNoControls how empty tiles (those with an index of -1) are stored in the LayerData. If true, empty tile positions are stored as null. If false, a Tile object with an index of -1 is created for each empty position instead.

Returns: Array.<Phaser.Tilemaps.LayerData> - - An array of LayerData objects, one for each entry in

json.layer.

Source: src/tilemaps/parsers/impact/ParseTileLayers.js#L10
Since: 3.0.0


ParseTilesets

<static> ParseTilesets(json)

Description:

Parses all unique tilesets from an Impact (Weltmeister) tilemap JSON object and returns them as an array of Tileset instances. Each layer in the JSON is inspected for a tileset name; duplicate names and collision layers (which have a blank tileset name) are ignored. Tile IDs within Impact tilesets are relative to the tileset rather than globally unique, and tilesets have no margin or padding, so each Tileset is created with those values set to zero.

Parameters:

nametypeoptionaldescription
jsonobjectNoThe Impact JSON data.

Returns: array - An array of Tilesets.

Source: src/tilemaps/parsers/impact/ParseTilesets.js#L9
Since: 3.0.0


ParseWeltmeister

<static> ParseWeltmeister(name, json, insertNull)

Description:

Parses a Weltmeister JSON object into a new MapData object.

Parameters:

nametypeoptionaldescription
namestringNoThe name of the tilemap, used to set the name on the MapData.
jsonobjectNoThe Weltmeister JSON object.
insertNullbooleanNoControls 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.

Returns: Phaser.Tilemaps.MapData - The created MapData object, or null if the data can't be parsed.

Source: src/tilemaps/parsers/impact/ParseWeltmeister.js#L12
Since: 3.0.0