Phaser API Documentation

  Version: 
getTileAt(tileX, tileY, [nonNull], [layer])

Description:

Gets a tile at the given tile coordinates from the given layer.

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

Parameters:

name type arguments description
tileX number

X position to get the tile from (given in tile units, not pixels).

tileY number

Y position to get the tile from (given in tile units, not pixels).

nonNull boolean <optional>

If true getTile won't return null for empty tiles, but a Tile object with an index of -1.

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

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

Returns:
Description:

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

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