Phaser API Documentation

pointWithinHitArea(gameObject, x, y)


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.


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.


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

  • boolean
Since: 3.0.0