Phaser API Documentation

removeTileAtWorldXY(worldX, worldY, [replaceWithNull], [recalculateFaces], [camera], [layer])


Removes the tile at the given world coordinates in the specified layer and updates the layers collision information.

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


name type arguments description
worldX number

The x coordinate, in pixels.

worldY number

The y coordinate, in pixels.

replaceWithNull boolean <optional>

If true (the default), this will replace the tile at the specified location with null instead of a Tile with an index of -1.

recalculateFaces boolean <optional>

If true (the default), the faces data will be recalculated.

camera Phaser.Cameras.Scene2D.Camera <optional>

The Camera to use when calculating the tile index from the world values.

layer string | number | Phaser.Tilemaps.TilemapLayer <optional>

The tile layer to use. If not given the current layer is used.


Returns a Tile, or null if the layer given was invalid.

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