Phaser API Documentation

  Version: 
getLayer([layer])

Description:

Gets the LayerData from this.layers that is associated with the given layer, or null if the layer is invalid.

Parameters:

name type arguments description
layer string | number | Phaser.Tilemaps.TilemapLayer <optional>

The name of the layer from Tiled, the index of the layer in the map or Tilemap Layer. If not given will default to the maps current layer index.

Returns:
Description:

The corresponding LayerData within this.layers.

Since: 3.0.0
Source: src/tilemaps/Tilemap.js (Line 1187)