Phaser API Documentation


Member of: Phaser.Actions

<static> SetHitArea(items, hitArea, hitAreaCallback)


Passes all provided Game Objects to the Input Manager to enable them for input with identical areas and callbacks.


name type description
items array | Array.<Phaser.GameObjects.GameObject>

An array of Game Objects. The contents of this array are updated by this Action.

hitArea *

Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used.

hitAreaCallback Phaser.Types.Input.HitAreaCallback

A callback to be invoked when the Game Object is interacted with. If you provide a shape you must also provide a callback.


The array of Game Objects that was passed to this Action.

Since: 3.0.0
Source: src/actions/SetHitArea.js (Line 7)