Phaser API Documentation

  Version: 

Member of: Phaser.Actions

<static> SetHitArea(items, hitArea, hitAreaCallback)

Description:

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

Parameters:

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.

Returns:
Description:

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

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