PokéRogue
    Preparing search index...

    Stores all data associated with a single layer in a tilemap. When a map is parsed from CSV, Tiled JSON, or other formats, each tile layer is converted into a LayerData instance that holds the tile grid, layer dimensions, orientation, visibility, physics bodies, tile callbacks, and any custom properties defined in the editor.

    Both Tilemap and TilemapLayer hold a reference to LayerData and use it to look up tile positions, perform collision checks, and drive rendering.

    Index
    alpha: number

    The alpha value of the layer.

    baseTileHeight: number

    The base tile height, in pixels. This is the tile height defined at the map level and is used to calculate pixel coordinates and layer dimensions. It defaults to tileHeight but may differ for layers that use a different tile size than the map default.

    baseTileWidth: number

    The base tile width, in pixels. This is the tile width defined at the map level and is used to calculate pixel coordinates and layer dimensions. It defaults to tileWidth but may differ for layers that use a different tile size than the map default.

    bodies: any[]

    An array of physics bodies.

    callbacks: any[]

    An array of tile location callbacks registered for this layer. Each entry maps a tile index to a callback function that is invoked when a physics-enabled Game Object overlaps or collides with that tile.

    collideIndexes: any[]

    Tile Collision ID index map.

    data: Tile[][]

    A 2D array of Tile objects representing the tile grid for this layer. Indexed as data[row][col], where each entry is a Tile instance (or null for an empty cell).

    height: number

    The height of the layer in tiles.

    heightInPixels: number

    The height in pixels of the entire layer.

    hexSideLength: number

    The length of the horizontal sides of the hexagon. Only used for hexagonal orientation Tilemaps.

    id: number

    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.

    indexes: any[]

    Tile ID index map.

    name: string

    The name of the layer, if specified in Tiled.

    orientation: Orientation

    The layer's orientation, necessary to be able to determine a tile's pixelX and pixelY as well as the layer's width and height.

    properties: object[]

    Layer specific properties (can be specified in Tiled).

    staggerAxis: string

    The Stagger Axis as defined in Tiled.

    Only used for hexagonal orientation Tilemaps.

    staggerIndex: string

    The Stagger Index as defined in Tiled.

    Either 'odd' or 'even'.

    Only used for hexagonal orientation Tilemaps.

    tileHeight: number

    The pixel height of the tiles.

    tilemapLayer: TilemapLayer

    A reference to the Tilemap layer that owns this data.

    tileWidth: number

    The pixel width of the tiles.

    visible: boolean

    Is the layer visible or not?

    width: number

    The width of the layer in tiles.

    widthInPixels: number

    The width in pixels of the entire layer.

    x: number

    The x offset of where to draw from the top left.

    y: number

    The y offset of where to draw from the top left.