getTile(x, y, layer, nonNull) → {Phaser.Tile}
Gets a tile from the Tilemap Layer. The coordinates are given in tile values.
Parameters
Name | Type | Argument | Default | Description |
---|---|---|---|---|
x | number | X position to get the tile from (given in tile units, not pixels) | ||
y | number | Y position to get the tile from (given in tile units, not pixels) | ||
layer | number | string | Phaser.TilemapLayer | <optional> | The layer to get the tile from. | |
nonNull | boolean | <optional> | false | If true getTile won't return null for empty tiles, but a Tile object with an index of -1. |
Returns
The tile at the given coordinates or null if no tile was found or the coordinates were invalid.
- Source code: tilemap/Tilemap.js (Line 1476)
Please login to continue.