Phaser API Documentation

  Version: 
hasTileAtWorldXY(worldX, worldY, [camera])

Description:

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.

Parameters:

name type arguments description
worldX number

The x coordinate, in pixels.

worldY number

The y coordinate, in pixels.

camera Phaser.Cameras.Scene2D.Camera <optional>

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

Returns:
Description:

true if a tile was found at the given location, otherwise false.

Type:
  • boolean
Since: 3.50.0