Gets a tile at the given world coordinates from the given layer.
If no layer is specified, the maps current layer is used.
name | type | arguments | Default | description |
---|---|---|---|---|
worldX | number |
X position to get the tile from (given in pixels) |
||
worldY | number |
Y position to get the tile from (given in pixels) |
||
nonNull | boolean | <optional> | false |
For empty tiles, return a Tile object with an index of -1 instead of null. |
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.