Phaser API Documentation

  Version: 
getLayerIndex([layer])

Description:

Gets the LayerData index of the given layer within this.layers, or null if an invalid layer is given.

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 a Tilemap Layer. If not given will default to the map's current layer index.

Returns:
Description:

The LayerData index within this.layers.

Type:
  • number
Since: 3.0.0
Source: src/tilemaps/Tilemap.js (Line 1242)