Phaser API Documentation

  Version: 
destroyLayer([layer])

Description:

Destroys the given TilemapLayer and removes it from this Tilemap.

If no layer is specified, the maps current layer is used.

Parameters:

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

The tile layer to be destroyed.

Returns:
Description:

Returns this, or null if the layer given was invalid.

Since: 3.17.0
Source: src/tilemaps/Tilemap.js (Line 1766)