Phaser API Documentation

<static> HasTileAtWorldXY(worldX, worldY, camera, layer)


Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns false if there is no tile or if the tile at that location has an index of -1.


name type description
worldX number

The X coordinate of the world position.

worldY number

The Y coordinate of the world position.

camera Phaser.Cameras.Scene2D.Camera

The Camera to use when factoring in which tiles to return.

layer Phaser.Tilemaps.LayerData

The Tilemap Layer to act upon.


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

  • boolean
Since: 3.0.0