Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the layer's position, scale and scroll.
name | type | description |
---|---|---|
worldX | number |
The x coordinate to be converted, in pixels, not tiles. |
snapToFloor | boolean |
Whether or not to round the tile coordinate down to the nearest integer. |
camera | Phaser.Cameras.Scene2D.Camera |
The Camera to use when calculating the tile index from the world values. |
layer | Phaser.Tilemaps.LayerData |
The Tilemap Layer to act upon. |
The X location in tile units.