Namespace: Events

Phaser.Input. Events

Events


BOOT

The Input Plugin Boot Event.

This internal event is dispatched by the Input Plugin when it boots, signalling to all of its systems to create themselves.

Since: 3.0.0
Source: src/input/events/BOOT_EVENT.js (Line 7)

DESTROY

The Input Plugin Destroy Event.

This internal event is dispatched by the Input Plugin when it is destroyed, signalling to all of its systems to destroy themselves.

Since: 3.0.0
Source: src/input/events/DESTROY_EVENT.js (Line 7)

DRAG

The Pointer Drag Input Event.

This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves while dragging a Game Object.

Listen to this event from within a Scene using: this.input.on('drag', listener).

A Pointer can only drag a single Game Object at once.

To listen for this event from a specific Game Object, use the GAMEOBJECT_DRAG event instead.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

gameObject Phaser.GameObjects.GameObject

The interactive Game Object that this pointer is dragging.

dragX number

The x coordinate where the Pointer is currently dragging the Game Object, in world space.

dragY number

The y coordinate where the Pointer is currently dragging the Game Object, in world space.

Since: 3.0.0
Source: src/input/events/DRAG_EVENT.js (Line 7)

DRAG_END

The Pointer Drag End Input Event.

This event is dispatched by the Input Plugin belonging to a Scene if a pointer stops dragging a Game Object.

Listen to this event from within a Scene using: this.input.on('dragend', listener).

To listen for this event from a specific Game Object, use the GAMEOBJECT_DRAG_END event instead.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

gameObject Phaser.GameObjects.GameObject

The interactive Game Object that this pointer stopped dragging.

Since: 3.0.0
Source: src/input/events/DRAG_END_EVENT.js (Line 7)

DRAG_ENTER

The Pointer Drag Enter Input Event.

This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object into a Drag Target.

Listen to this event from within a Scene using: this.input.on('dragenter', listener).

A Pointer can only drag a single Game Object at once.

To listen for this event from a specific Game Object, use the GAMEOBJECT_DRAG_ENTER event instead.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

gameObject Phaser.GameObjects.GameObject

The interactive Game Object that this pointer is dragging.

target Phaser.GameObjects.GameObject

The drag target that this pointer has moved into.

Since: 3.0.0
Source: src/input/events/DRAG_ENTER_EVENT.js (Line 7)

DRAG_LEAVE

The Pointer Drag Leave Input Event.

This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object out of a Drag Target.

Listen to this event from within a Scene using: this.input.on('dragleave', listener).

A Pointer can only drag a single Game Object at once.

To listen for this event from a specific Game Object, use the GAMEOBJECT_DRAG_LEAVE event instead.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

gameObject Phaser.GameObjects.GameObject

The interactive Game Object that this pointer is dragging.

target Phaser.GameObjects.GameObject

The drag target that this pointer has left.

Since: 3.0.0
Source: src/input/events/DRAG_LEAVE_EVENT.js (Line 7)

DRAG_OVER

The Pointer Drag Over Input Event.

This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object over a Drag Target.

When the Game Object first enters the drag target it will emit a dragenter event. If it then moves while within the drag target, it will emit this event instead.

Listen to this event from within a Scene using: this.input.on('dragover', listener).

A Pointer can only drag a single Game Object at once.

To listen for this event from a specific Game Object, use the GAMEOBJECT_DRAG_OVER event instead.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

gameObject Phaser.GameObjects.GameObject

The interactive Game Object that this pointer is dragging.

target Phaser.GameObjects.GameObject

The drag target that this pointer has moved over.

Since: 3.0.0
Source: src/input/events/DRAG_OVER_EVENT.js (Line 7)

DRAG_START

The Pointer Drag Start Input Event.

This event is dispatched by the Input Plugin belonging to a Scene if a pointer starts to drag any Game Object.

Listen to this event from within a Scene using: this.input.on('dragstart', listener).

A Pointer can only drag a single Game Object at once.

To listen for this event from a specific Game Object, use the GAMEOBJECT_DRAG_START event instead.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

gameObject Phaser.GameObjects.GameObject

The interactive Game Object that this pointer is dragging.

Since: 3.0.0
Source: src/input/events/DRAG_START_EVENT.js (Line 7)

DROP

The Pointer Drop Input Event.

This event is dispatched by the Input Plugin belonging to a Scene if a pointer drops a Game Object on a Drag Target.

Listen to this event from within a Scene using: this.input.on('drop', listener).

To listen for this event from a specific Game Object, use the GAMEOBJECT_DROP event instead.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

gameObject Phaser.GameObjects.GameObject

The interactive Game Object that this pointer was dragging.

target Phaser.GameObjects.GameObject

The Drag Target the gameObject has been dropped on.

Since: 3.0.0
Source: src/input/events/DROP_EVENT.js (Line 7)

GAME_OUT

The Input Plugin Game Out Event.

This event is dispatched by the Input Plugin if the active pointer leaves the game canvas and is now outside of it, elsewhere on the web page.

Listen to this event from within a Scene using: this.input.on('gameout', listener).

Parameters:
Name Type Description
time number

The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.

event MouseEvent | TouchEvent

The DOM Event that triggered the canvas out.

Since: 3.16.1
Source: src/input/events/GAME_OUT_EVENT.js (Line 7)

GAME_OVER

The Input Plugin Game Over Event.

This event is dispatched by the Input Plugin if the active pointer enters the game canvas and is now over of it, having previously been elsewhere on the web page.

Listen to this event from within a Scene using: this.input.on('gameover', listener).

Parameters:
Name Type Description
time number

The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.

event MouseEvent | TouchEvent

The DOM Event that triggered the canvas over.

Since: 3.16.1
Source: src/input/events/GAME_OVER_EVENT.js (Line 7)

GAMEOBJECT_DOWN

The Game Object Down Input Event.

This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down on any interactive Game Object.

Listen to this event from within a Scene using: this.input.on('gameobjectdown', listener).

To receive this event, the Game Objects must have been set as interactive. See GameObject.setInteractive for more details.

To listen for this event from a specific Game Object, use the GAMEOBJECT_POINTER_DOWN event instead.

The event hierarchy is as follows:

  1. GAMEOBJECT_POINTER_DOWN
  2. GAMEOBJECT_DOWN
  3. POINTER_DOWN or POINTER_DOWN_OUTSIDE

With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop the propagation of this event.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

gameObject Phaser.GameObjects.GameObject

The Game Object the pointer was pressed down on.

event Phaser.Types.Input.EventData

The Phaser input event. You can call stopPropagation() to halt it from going any further in the event flow.

Since: 3.0.0
Source: src/input/events/GAMEOBJECT_DOWN_EVENT.js (Line 7)

GAMEOBJECT_DRAG

The Game Object Drag Event.

This event is dispatched by an interactive Game Object if a pointer moves while dragging it.

Listen to this event from a Game Object using: gameObject.on('drag', listener). Note that the scope of the listener is automatically set to be the Game Object instance itself.

To receive this event, the Game Object must have been set as interactive and enabled for drag. See GameObject.setInteractive for more details.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

dragX number

The x coordinate where the Pointer is currently dragging the Game Object, in world space.

dragY number

The y coordinate where the Pointer is currently dragging the Game Object, in world space.

Since: 3.0.0
Source: src/input/events/GAMEOBJECT_DRAG_EVENT.js (Line 7)

GAMEOBJECT_DRAG_END

The Game Object Drag End Event.

This event is dispatched by an interactive Game Object if a pointer stops dragging it.

Listen to this event from a Game Object using: gameObject.on('dragend', listener). Note that the scope of the listener is automatically set to be the Game Object instance itself.

To receive this event, the Game Object must have been set as interactive and enabled for drag. See GameObject.setInteractive for more details.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

dragX number

The x coordinate where the Pointer stopped dragging the Game Object, in world space.

dragY number

The y coordinate where the Pointer stopped dragging the Game Object, in world space.

Since: 3.0.0
Source: src/input/events/GAMEOBJECT_DRAG_END_EVENT.js (Line 7)

GAMEOBJECT_DRAG_ENTER

The Game Object Drag Enter Event.

This event is dispatched by an interactive Game Object if a pointer drags it into a drag target.

Listen to this event from a Game Object using: gameObject.on('dragenter', listener). Note that the scope of the listener is automatically set to be the Game Object instance itself.

To receive this event, the Game Object must have been set as interactive and enabled for drag. See GameObject.setInteractive for more details.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

target Phaser.GameObjects.GameObject

The drag target that this pointer has moved into.

Since: 3.0.0
Source: src/input/events/GAMEOBJECT_DRAG_ENTER_EVENT.js (Line 7)

GAMEOBJECT_DRAG_LEAVE

The Game Object Drag Leave Event.

This event is dispatched by an interactive Game Object if a pointer drags it out of a drag target.

Listen to this event from a Game Object using: gameObject.on('dragleave', listener). Note that the scope of the listener is automatically set to be the Game Object instance itself.

To receive this event, the Game Object must have been set as interactive and enabled for drag. See GameObject.setInteractive for more details.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

target Phaser.GameObjects.GameObject

The drag target that this pointer has left.

Since: 3.0.0
Source: src/input/events/GAMEOBJECT_DRAG_LEAVE_EVENT.js (Line 7)

GAMEOBJECT_DRAG_OVER

The Game Object Drag Over Event.

This event is dispatched by an interactive Game Object if a pointer drags it over a drag target.

When the Game Object first enters the drag target it will emit a dragenter event. If it then moves while within the drag target, it will emit this event instead.

Listen to this event from a Game Object using: gameObject.on('dragover', listener). Note that the scope of the listener is automatically set to be the Game Object instance itself.

To receive this event, the Game Object must have been set as interactive and enabled for drag. See GameObject.setInteractive for more details.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

target Phaser.GameObjects.GameObject

The drag target that this pointer has moved over.

Since: 3.0.0
Source: src/input/events/GAMEOBJECT_DRAG_OVER_EVENT.js (Line 7)

GAMEOBJECT_DRAG_START

The Game Object Drag Start Event.

This event is dispatched by an interactive Game Object if a pointer starts to drag it.

Listen to this event from a Game Object using: gameObject.on('dragstart', listener). Note that the scope of the listener is automatically set to be the Game Object instance itself.

To receive this event, the Game Object must have been set as interactive and enabled for drag. See GameObject.setInteractive for more details.

There are lots of useful drag related properties that are set within the Game Object when dragging occurs. For example, gameObject.input.dragStartX, dragStartY and so on.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

dragX number

The x coordinate where the Pointer is currently dragging the Game Object, in world space.

dragY number

The y coordinate where the Pointer is currently dragging the Game Object, in world space.

Since: 3.0.0
Source: src/input/events/GAMEOBJECT_DRAG_START_EVENT.js (Line 7)

GAMEOBJECT_DROP

The Game Object Drop Event.

This event is dispatched by an interactive Game Object if a pointer drops it on a Drag Target.

Listen to this event from a Game Object using: gameObject.on('drop', listener). Note that the scope of the listener is automatically set to be the Game Object instance itself.

To receive this event, the Game Object must have been set as interactive and enabled for drag. See GameObject.setInteractive for more details.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

target Phaser.GameObjects.GameObject

The Drag Target the gameObject has been dropped on.

Since: 3.0.0
Source: src/input/events/GAMEOBJECT_DROP_EVENT.js (Line 7)

GAMEOBJECT_MOVE

The Game Object Move Input Event.

This event is dispatched by the Input Plugin belonging to a Scene if a pointer is moved across any interactive Game Object.

Listen to this event from within a Scene using: this.input.on('gameobjectmove', listener).

To receive this event, the Game Objects must have been set as interactive. See GameObject.setInteractive for more details.

To listen for this event from a specific Game Object, use the GAMEOBJECT_POINTER_MOVE event instead.

The event hierarchy is as follows:

  1. GAMEOBJECT_POINTER_MOVE
  2. GAMEOBJECT_MOVE
  3. POINTER_MOVE

With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop the propagation of this event.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

gameObject Phaser.GameObjects.GameObject

The Game Object the pointer was moved on.

event Phaser.Types.Input.EventData

The Phaser input event. You can call stopPropagation() to halt it from going any further in the event flow.

Since: 3.0.0
Source: src/input/events/GAMEOBJECT_MOVE_EVENT.js (Line 7)

GAMEOBJECT_OUT

The Game Object Out Input Event.

This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves out of any interactive Game Object.

Listen to this event from within a Scene using: this.input.on('gameobjectout', listener).

To receive this event, the Game Objects must have been set as interactive. See GameObject.setInteractive for more details.

To listen for this event from a specific Game Object, use the GAMEOBJECT_POINTER_OUT event instead.

The event hierarchy is as follows:

  1. GAMEOBJECT_POINTER_OUT
  2. GAMEOBJECT_OUT
  3. POINTER_OUT

With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop the propagation of this event.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

gameObject Phaser.GameObjects.GameObject

The Game Object the pointer moved out of.

event Phaser.Types.Input.EventData

The Phaser input event. You can call stopPropagation() to halt it from going any further in the event flow.

Since: 3.0.0
Source: src/input/events/GAMEOBJECT_OUT_EVENT.js (Line 7)

GAMEOBJECT_OVER

The Game Object Over Input Event.

This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves over any interactive Game Object.

Listen to this event from within a Scene using: this.input.on('gameobjectover', listener).

To receive this event, the Game Objects must have been set as interactive. See GameObject.setInteractive for more details.

To listen for this event from a specific Game Object, use the GAMEOBJECT_POINTER_OVER event instead.

The event hierarchy is as follows:

  1. GAMEOBJECT_POINTER_OVER
  2. GAMEOBJECT_OVER
  3. POINTER_OVER

With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop the propagation of this event.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

gameObject Phaser.GameObjects.GameObject

The Game Object the pointer moved over.

event Phaser.Types.Input.EventData

The Phaser input event. You can call stopPropagation() to halt it from going any further in the event flow.

Since: 3.0.0
Source: src/input/events/GAMEOBJECT_OVER_EVENT.js (Line 7)

GAMEOBJECT_POINTER_DOWN

The Game Object Pointer Down Event.

This event is dispatched by an interactive Game Object if a pointer is pressed down on it.

Listen to this event from a Game Object using: gameObject.on('pointerdown', listener). Note that the scope of the listener is automatically set to be the Game Object instance itself.

To receive this event, the Game Object must have been set as interactive. See GameObject.setInteractive for more details.

The event hierarchy is as follows:

  1. GAMEOBJECT_POINTER_DOWN
  2. GAMEOBJECT_DOWN
  3. POINTER_DOWN or POINTER_DOWN_OUTSIDE

With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop the propagation of this event.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

localX number

The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.

localY number

The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.

event Phaser.Types.Input.EventData

The Phaser input event. You can call stopPropagation() to halt it from going any further in the event flow.

Since: 3.0.0
Source: src/input/events/GAMEOBJECT_POINTER_DOWN_EVENT.js (Line 7)

GAMEOBJECT_POINTER_MOVE

The Game Object Pointer Move Event.

This event is dispatched by an interactive Game Object if a pointer is moved while over it.

Listen to this event from a Game Object using: gameObject.on('pointermove', listener). Note that the scope of the listener is automatically set to be the Game Object instance itself.

To receive this event, the Game Object must have been set as interactive. See GameObject.setInteractive for more details.

The event hierarchy is as follows:

  1. GAMEOBJECT_POINTER_MOVE
  2. GAMEOBJECT_MOVE
  3. POINTER_MOVE

With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop the propagation of this event.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

localX number

The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.

localY number

The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.

event Phaser.Types.Input.EventData

The Phaser input event. You can call stopPropagation() to halt it from going any further in the event flow.

Since: 3.0.0
Source: src/input/events/GAMEOBJECT_POINTER_MOVE_EVENT.js (Line 7)

GAMEOBJECT_POINTER_OUT

The Game Object Pointer Out Event.

This event is dispatched by an interactive Game Object if a pointer moves out of it.

Listen to this event from a Game Object using: gameObject.on('pointerout', listener). Note that the scope of the listener is automatically set to be the Game Object instance itself.

To receive this event, the Game Object must have been set as interactive. See GameObject.setInteractive for more details.

The event hierarchy is as follows:

  1. GAMEOBJECT_POINTER_OUT
  2. GAMEOBJECT_OUT
  3. POINTER_OUT

With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop the propagation of this event.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

event Phaser.Types.Input.EventData

The Phaser input event. You can call stopPropagation() to halt it from going any further in the event flow.

Since: 3.0.0
Source: src/input/events/GAMEOBJECT_POINTER_OUT_EVENT.js (Line 7)

GAMEOBJECT_POINTER_OVER

The Game Object Pointer Over Event.

This event is dispatched by an interactive Game Object if a pointer moves over it.

Listen to this event from a Game Object using: gameObject.on('pointerover', listener). Note that the scope of the listener is automatically set to be the Game Object instance itself.

To receive this event, the Game Object must have been set as interactive. See GameObject.setInteractive for more details.

The event hierarchy is as follows:

  1. GAMEOBJECT_POINTER_OVER
  2. GAMEOBJECT_OVER
  3. POINTER_OVER

With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop the propagation of this event.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

localX number

The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.

localY number

The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.

event Phaser.Types.Input.EventData

The Phaser input event. You can call stopPropagation() to halt it from going any further in the event flow.

Since: 3.0.0
Source: src/input/events/GAMEOBJECT_POINTER_OVER_EVENT.js (Line 7)

GAMEOBJECT_POINTER_UP

The Game Object Pointer Up Event.

This event is dispatched by an interactive Game Object if a pointer is released while over it.

Listen to this event from a Game Object using: gameObject.on('pointerup', listener). Note that the scope of the listener is automatically set to be the Game Object instance itself.

To receive this event, the Game Object must have been set as interactive. See GameObject.setInteractive for more details.

The event hierarchy is as follows:

  1. GAMEOBJECT_POINTER_UP
  2. GAMEOBJECT_UP
  3. POINTER_UP or POINTER_UP_OUTSIDE

With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop the propagation of this event.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

localX number

The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.

localY number

The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.

event Phaser.Types.Input.EventData

The Phaser input event. You can call stopPropagation() to halt it from going any further in the event flow.

Since: 3.0.0
Source: src/input/events/GAMEOBJECT_POINTER_UP_EVENT.js (Line 7)

GAMEOBJECT_POINTER_WHEEL

The Game Object Pointer Wheel Event.

This event is dispatched by an interactive Game Object if a pointer has its wheel moved while over it.

Listen to this event from a Game Object using: gameObject.on('wheel', listener). Note that the scope of the listener is automatically set to be the Game Object instance itself.

To receive this event, the Game Object must have been set as interactive. See GameObject.setInteractive for more details.

The event hierarchy is as follows:

  1. GAMEOBJECT_POINTER_WHEEL
  2. GAMEOBJECT_WHEEL
  3. POINTER_WHEEL

With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop the propagation of this event.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

deltaX number

The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device.

deltaY number

The vertical scroll amount that occurred due to the user moving a mouse wheel or similar input device. This value will typically be less than 0 if the user scrolls up and greater than zero if scrolling down.

deltaZ number

The z-axis scroll amount that occurred due to the user moving a mouse wheel or similar input device.

event Phaser.Types.Input.EventData

The Phaser input event. You can call stopPropagation() to halt it from going any further in the event flow.

Since: 3.18.0
Source: src/input/events/GAMEOBJECT_POINTER_WHEEL_EVENT.js (Line 7)

GAMEOBJECT_UP

The Game Object Up Input Event.

This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released while over any interactive Game Object.

Listen to this event from within a Scene using: this.input.on('gameobjectup', listener).

To receive this event, the Game Objects must have been set as interactive. See GameObject.setInteractive for more details.

To listen for this event from a specific Game Object, use the GAMEOBJECT_POINTER_UP event instead.

The event hierarchy is as follows:

  1. GAMEOBJECT_POINTER_UP
  2. GAMEOBJECT_UP
  3. POINTER_UP or POINTER_UP_OUTSIDE

With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop the propagation of this event.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

gameObject Phaser.GameObjects.GameObject

The Game Object the pointer was over when released.

event Phaser.Types.Input.EventData

The Phaser input event. You can call stopPropagation() to halt it from going any further in the event flow.

Since: 3.0.0
Source: src/input/events/GAMEOBJECT_UP_EVENT.js (Line 7)

GAMEOBJECT_WHEEL

The Game Object Wheel Input Event.

This event is dispatched by the Input Plugin belonging to a Scene if a pointer has its wheel moved while over any interactive Game Object.

Listen to this event from within a Scene using: this.input.on('gameobjectwheel', listener).

To receive this event, the Game Objects must have been set as interactive. See GameObject.setInteractive for more details.

To listen for this event from a specific Game Object, use the GAMEOBJECT_POINTER_WHEEL event instead.

The event hierarchy is as follows:

  1. GAMEOBJECT_POINTER_WHEEL
  2. GAMEOBJECT_WHEEL
  3. POINTER_WHEEL

With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop the propagation of this event.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

gameObject Phaser.GameObjects.GameObject

The Game Object the pointer was over when the wheel changed.

deltaX number

The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device.

deltaY number

The vertical scroll amount that occurred due to the user moving a mouse wheel or similar input device. This value will typically be less than 0 if the user scrolls up and greater than zero if scrolling down.

deltaZ number

The z-axis scroll amount that occurred due to the user moving a mouse wheel or similar input device.

event Phaser.Types.Input.EventData

The Phaser input event. You can call stopPropagation() to halt it from going any further in the event flow.

Since: 3.18.0
Source: src/input/events/GAMEOBJECT_WHEEL_EVENT.js (Line 7)

MANAGER_BOOT

The Input Manager Boot Event.

This internal event is dispatched by the Input Manager when it boots.

Since: 3.0.0
Source: src/input/events/MANAGER_BOOT_EVENT.js (Line 7)

MANAGER_PROCESS

The Input Manager Process Event.

This internal event is dispatched by the Input Manager when not using the legacy queue system, and it wants the Input Plugins to update themselves.

Parameters:
Name Type Description
time number

The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.

delta number

The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.

Since: 3.0.0
Source: src/input/events/MANAGER_PROCESS_EVENT.js (Line 7)

MANAGER_UPDATE

The Input Manager Update Event.

This internal event is dispatched by the Input Manager as part of its update step.

Since: 3.0.0
Source: src/input/events/MANAGER_UPDATE_EVENT.js (Line 7)

POINTER_DOWN

The Pointer Down Input Event.

This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down anywhere.

Listen to this event from within a Scene using: this.input.on('pointerdown', listener).

The event hierarchy is as follows:

  1. GAMEOBJECT_POINTER_DOWN
  2. GAMEOBJECT_DOWN
  3. POINTER_DOWN or POINTER_DOWN_OUTSIDE

With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop the propagation of this event.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

currentlyOver Array.<Phaser.GameObjects.GameObject>

An array containing all interactive Game Objects that the pointer was over when the event was created.

Since: 3.0.0
Source: src/input/events/POINTER_DOWN_EVENT.js (Line 7)

POINTER_DOWN_OUTSIDE

The Pointer Down Outside Input Event.

This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down anywhere outside of the game canvas.

Listen to this event from within a Scene using: this.input.on('pointerdownoutside', listener).

The event hierarchy is as follows:

  1. GAMEOBJECT_POINTER_DOWN
  2. GAMEOBJECT_DOWN
  3. POINTER_DOWN or POINTER_DOWN_OUTSIDE

With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop the propagation of this event.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

Since: 3.16.1
Source: src/input/events/POINTER_DOWN_OUTSIDE_EVENT.js (Line 7)

POINTER_MOVE

The Pointer Move Input Event.

This event is dispatched by the Input Plugin belonging to a Scene if a pointer is moved anywhere.

Listen to this event from within a Scene using: this.input.on('pointermove', listener).

The event hierarchy is as follows:

  1. GAMEOBJECT_POINTER_MOVE
  2. GAMEOBJECT_MOVE
  3. POINTER_MOVE

With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop the propagation of this event.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

currentlyOver Array.<Phaser.GameObjects.GameObject>

An array containing all interactive Game Objects that the pointer was over when the event was created.

Since: 3.0.0
Source: src/input/events/POINTER_MOVE_EVENT.js (Line 7)

POINTER_OUT

The Pointer Out Input Event.

This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves out of any interactive Game Object.

Listen to this event from within a Scene using: this.input.on('pointerout', listener).

The event hierarchy is as follows:

  1. GAMEOBJECT_POINTER_OUT
  2. GAMEOBJECT_OUT
  3. POINTER_OUT

With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop the propagation of this event.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

justOut Array.<Phaser.GameObjects.GameObject>

An array containing all interactive Game Objects that the pointer moved out of when the event was created.

Since: 3.0.0
Source: src/input/events/POINTER_OUT_EVENT.js (Line 7)

POINTER_OVER

The Pointer Over Input Event.

This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves over any interactive Game Object.

Listen to this event from within a Scene using: this.input.on('pointerover', listener).

The event hierarchy is as follows:

  1. GAMEOBJECT_POINTER_OVER
  2. GAMEOBJECT_OVER
  3. POINTER_OVER

With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop the propagation of this event.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

justOver Array.<Phaser.GameObjects.GameObject>

An array containing all interactive Game Objects that the pointer moved over when the event was created.

Since: 3.0.0
Source: src/input/events/POINTER_OVER_EVENT.js (Line 7)

POINTER_UP

The Pointer Up Input Event.

This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released anywhere.

Listen to this event from within a Scene using: this.input.on('pointerup', listener).

The event hierarchy is as follows:

  1. GAMEOBJECT_POINTER_UP
  2. GAMEOBJECT_UP
  3. POINTER_UP or POINTER_UP_OUTSIDE

With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop the propagation of this event.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

currentlyOver Array.<Phaser.GameObjects.GameObject>

An array containing all interactive Game Objects that the pointer was over when the event was created.

Since: 3.0.0
Source: src/input/events/POINTER_UP_EVENT.js (Line 7)

POINTER_UP_OUTSIDE

The Pointer Up Outside Input Event.

This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released anywhere outside of the game canvas.

Listen to this event from within a Scene using: this.input.on('pointerupoutside', listener).

The event hierarchy is as follows:

  1. GAMEOBJECT_POINTER_UP
  2. GAMEOBJECT_UP
  3. POINTER_UP or POINTER_UP_OUTSIDE

With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop the propagation of this event.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

Since: 3.16.1
Source: src/input/events/POINTER_UP_OUTSIDE_EVENT.js (Line 7)

POINTER_WHEEL

The Pointer Wheel Input Event.

This event is dispatched by the Input Plugin belonging to a Scene if a pointer has its wheel updated.

Listen to this event from within a Scene using: this.input.on('wheel', listener).

The event hierarchy is as follows:

  1. GAMEOBJECT_POINTER_WHEEL
  2. GAMEOBJECT_WHEEL
  3. POINTER_WHEEL

With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop the propagation of this event.

Parameters:
Name Type Description
pointer Phaser.Input.Pointer

The Pointer responsible for triggering this event.

currentlyOver Array.<Phaser.GameObjects.GameObject>

An array containing all interactive Game Objects that the pointer was over when the event was created.

deltaX number

The horizontal scroll amount that occurred due to the user moving a mouse wheel or similar input device.

deltaY number

The vertical scroll amount that occurred due to the user moving a mouse wheel or similar input device. This value will typically be less than 0 if the user scrolls up and greater than zero if scrolling down.

deltaZ number

The z-axis scroll amount that occurred due to the user moving a mouse wheel or similar input device.

Since: 3.18.0
Source: src/input/events/POINTER_WHEEL_EVENT.js (Line 7)

POINTERLOCK_CHANGE

The Input Manager Pointer Lock Change Event.

This event is dispatched by the Input Manager when it is processing a native Pointer Lock Change DOM Event.

Parameters:
Name Type Description
event Event

The native DOM Event.

locked boolean

The locked state of the Mouse Pointer.

Since: 3.0.0
Source: src/input/events/POINTERLOCK_CHANGE_EVENT.js (Line 7)

PRE_UPDATE

The Input Plugin Pre-Update Event.

This internal event is dispatched by the Input Plugin at the start of its preUpdate method. This hook is designed specifically for input plugins, but can also be listened to from user-land code.

Since: 3.0.0
Source: src/input/events/PRE_UPDATE_EVENT.js (Line 7)

SHUTDOWN

The Input Plugin Shutdown Event.

This internal event is dispatched by the Input Plugin when it shuts down, signalling to all of its systems to shut themselves down.

Since: 3.0.0
Source: src/input/events/SHUTDOWN_EVENT.js (Line 7)

START

The Input Plugin Start Event.

This internal event is dispatched by the Input Plugin when it has finished setting-up, signalling to all of its internal systems to start.

Since: 3.0.0
Source: src/input/events/START_EVENT.js (Line 7)

UPDATE

The Input Plugin Update Event.

This internal event is dispatched by the Input Plugin at the start of its update method. This hook is designed specifically for input plugins, but can also be listened to from user-land code.

Parameters:
Name Type Description
time number

The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.

delta number

The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.

Since: 3.0.0
Source: src/input/events/UPDATE_EVENT.js (Line 7)