Phaser API Documentation

  Version: 
getTilesWithinShape(shape, [filteringOptions], [camera])

Description:

Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, Line, Rectangle or Triangle. The shape should be in world coordinates.

Parameters:

name type arguments description
shape Phaser.Geom.Circle | Phaser.Geom.Line | Phaser.Geom.Rectangle | Phaser.Geom.Triangle

A shape in world (pixel) coordinates

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.

Returns:
Description:

An array of Tile objects found within the shape.

Type:
Since: 3.50.0