Phaser API Documentation

  Version: 
setLayer([layer])

Description:

Sets the current layer to the LayerData associated with layer.

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 TilemapLayer. If not given will default to the maps current layer index.

Returns:
Description:

This Tilemap object.

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