Phaser API Documentation

  Version: 
contains(x, y, [calcMatrix])

Description:

Checks if the given coordinates are within this Face.

You can optionally provide a transform matrix. If given, the Face vertices will be transformed first, before being checked against the coordinates.

Parameters:

name type arguments description
x number

The horizontal position to check.

y number

The vertical position to check.

calcMatrix Phaser.GameObjects.Components.TransformMatrix <optional>

Optional transform matrix to apply to the vertices before comparison.

Returns:
Description:

true if the coordinates lay within this Face, otherwise false.

Type:
  • boolean
Since: 3.50.0
Source: src/geom/mesh/Face.js (Line 169)