Phaser API Documentation

  Version: 

Member of: Phaser.Geom.Polygon

<static> Contains(polygon, x, y)

Description:

Checks if a point is within the bounds of a Polygon.

Parameters:

name type description
polygon Phaser.Geom.Polygon

The Polygon to check against.

x number

The X coordinate of the point to check.

y number

The Y coordinate of the point to check.

Returns:
Description:

true if the point is within the bounds of the Polygon, otherwise false.

Type:
  • boolean
Since: 3.0.0