Phaser API Documentation

  Version: 

Member of: Phaser.Geom.Polygon

contains(x, y)

Description:

Check to see if the Polygon contains the given x / y coordinates.

Parameters:

name type description
x number

The x coordinate to check within the polygon.

y number

The y coordinate to check within the polygon.

Returns:
Description:

true if the coordinates are within the polygon, otherwise false.

Type:
  • boolean
Examples:
Since: 3.0.0