getTileWorldXY(x, y, tileWidth, tileHeight, layer, nonNull) → {Phaser.Tile}
Gets a tile from the Tilemap layer. The coordinates are given in pixel values.
Parameters
Name | Type | Argument | Default | Description |
---|---|---|---|---|
x | number | X position to get the tile from (given in pixels) | ||
y | number | Y position to get the tile from (given in pixels) | ||
tileWidth | number | <optional> | The width of the tiles. If not given the map default is used. | |
tileHeight | number | <optional> | The height of the tiles. If not given the map default is used. | |
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.
- Source code: tilemap/Tilemap.js (Line 1517)
Please login to continue.