Phaser API Documentation

hasTileAt(tileX, tileY, [layer])


Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns false if there is no tile or if the tile at that location has an index of -1.

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


name type arguments description
tileX number

The x coordinate, in tiles, not pixels.

tileY number

The y coordinate, in tiles, not pixels.

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

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


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

  • boolean
Since: 3.0.0
Source: src/tilemaps/Tilemap.js (Line 1474)