Phaser API Documentation

  Version: 
pointWithinHitArea(gameObject, x, y)

Description:

Checks if the given x and y coordinate are within the hit area of the Game Object.

This method assumes that the coordinate values have already been translated into the space of the Game Object.

If the coordinates are within the hit area they are set into the Game Objects Input localX and localY properties.

Parameters:

name type description
gameObject Phaser.GameObjects.GameObject

The interactive Game Object to check against.

x number

The translated x coordinate for the hit test.

y number

The translated y coordinate for the hit test.

Returns:
Description:

true if the coordinates were inside the Game Objects hit area, otherwise false.

Type:
  • boolean
Since: 3.0.0