These archived docs are for Phaser 2.4.3 Phaser 3 docs can be found on
Phaser CE docs can be found on the Phaser CE Documentation site.


Phaser.Component. InputEnabled

new InputEnabled()

The InputEnabled component allows a Game Object to have its own InputHandler and process input related events.

Source code: gameobjects/components/InputEnabled.js (Line 12)

Public Properties

input : Phaser.InputHandler | null

The Input Handler for this Game Object.

By default it is disabled. If you wish this Game Object to process input events you should enable it with: inputEnabled = true.

After you have done this, this property will be a reference to the Phaser InputHandler.

Source code: gameobjects/components/InputEnabled.js (Line 24)

inputEnabled : boolean

By default a Game Object won't process any input events. By setting inputEnabled to true a Phaser.InputHandler is created for this Game Object and it will then start to process click / touch events and more.

You can then access the Input Handler via this.input.

Note that Input related events are dispatched from, i.e.: events.onInputDown.

If you set this property to false it will stop the Input Handler from processing any more input events.

Source code: gameobjects/components/InputEnabled.js (Line 38)