A class for representing data about about a layer in a map. Maps are parsed from CSV, Tiled, etc. into this format. Tilemap and TilemapLayer objects have a reference to this data and use it to look up and perform operations on tiles.
new LayerData([config])
name | type | arguments | description |
---|---|---|---|
config | Phaser.Types.Tilemaps.LayerDataConfig | <optional> |
The Layer Data configuration object. |
The alpha value of the layer.
The base tile height.
The base tile width.
An array of physics bodies.
An array of callbacks.
Tile Collision ID index map.
An array of the tile data indexes.
The height of the layer in tiles.
The height in pixels of the entire layer.
The length of the horizontal sides of the hexagon. Only used for hexagonal orientation Tilemaps.
The id of the layer, as specified in the map data.
Note: This is not the index of the layer in the map data, but its actual ID in Tiled.
Tile ID index map.
The name of the layer, if specified in Tiled.
The layers orientation, necessary to be able to determine a tiles pixelX and pixelY as well as the layers width and height.
Layer specific properties (can be specified in Tiled)
The Stagger Axis as defined in Tiled.
Only used for hexagonal orientation Tilemaps.
The Stagger Index as defined in Tiled.
Either 'odd' or 'even'.
Only used for hexagonal orientation Tilemaps.
The pixel height of the tiles.
The pixel width of the tiles.
A reference to the Tilemap layer that owns this data.
Is the layer visible or not?
The width of the layer in tiles.
The width in pixels of the entire layer.
The x offset of where to draw from the top left.
The y offset of where to draw from the top left.