Phaser API Documentation

getTilesWithinWorldXY(worldX, worldY, width, height, [filteringOptions], [camera])


Gets the tiles in the given rectangular area (in world coordinates) of the layer.


name type arguments description
worldX number

The world x coordinate for the top-left of the area.

worldY number

The world y coordinate for the top-left of the area.

width number

The width of the area.

height number

The height of the area.

filteringOptions Phaser.Types.Tilemaps.FilteringOptions <optional>

Optional filters to apply when getting the tiles.

camera Phaser.Cameras.Scene2D.Camera <optional>

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


An array of Tile objects found within the area.

Since: 3.50.0