Phaser API Documentation

  Version: 
getFaceAt(x, y, [camera])

Description:

Return an array of Face objects from this Mesh that intersect with the given coordinates.

The given position is translated through the matrix of this Mesh and the given Camera, before being compared against the vertices.

If more than one Face intersects, they will all be returned in the array, but the array will be depth sorted first, so the first element will always be that closest to the camera.

Parameters:

name type arguments description
x number

The x position to check against.

y number

The y position to check against.

camera Phaser.Cameras.Scene2D.Camera <optional>

The camera to pass the coordinates through. If not give, the default Scene Camera is used.

Returns:
Description:

An array of Face objects that intersect with the given point, ordered by depth.

Type:
Since: 3.50.0