-
Notifications
You must be signed in to change notification settings - Fork 16
input
Eloy Villasclaras edited this page Apr 13, 2016
·
1 revision
<input> configures the game input. It must be a child of
<game>, and there must be at most one
<input> node.
| Property | Notes |
|---|---|
pointers |
Number of input pointers (default: 2) |
onDown |
Callback for the onDown event. Receives two parameters:
|
onUp |
Callback for the onUp event. Receives two parameters:
|
onTap |
Callback for the onTap event. Receives two parameters:
|
onHold |
Callback for the onHold event. Receives two parameters:
|
keys |
An object mapping key names to Phaser key codes. E.g.:{p:Phaser.KeyCode.P}. The mapped keys are added to Phaser's keyboard input |
cursors |
If true, adds cursors to Phaser's keyboard input |
onInput |
A callback function invoked during the game update method. It receives the shared context¬ |
In addition to the keys property, <input> nodes can have <key> children, which
allow to define key-specific event listeners.