Phaser API Documentation

pointWithinInteractiveObject(object, x, y)


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

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

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


name type description
object Phaser.Types.Input.InteractiveObject

The Interactive 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