Phaser API Documentation

  Version: 
Filter
Namespace: Events
Phaser.Input.Events
Source: src/input/events/index.js (Line 7)

Events

BOOT
Focus
Focus

Description:

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
Focus
Focus
DESTROY
Focus
Focus

Description:

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
Focus
Focus
DRAG
Focus
Focus

Description:

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
Focus
Focus
DRAG_END
Focus
Focus

Description:

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
Focus
Focus
DRAG_ENTER
Focus
Focus

Description:

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
Focus
Focus
DRAG_LEAVE
Focus
Focus

Description:

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
Focus
Focus
DRAG_OVER
Focus
Focus

Description:

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
Focus
Focus
DRAG_START
Focus
Focus

Description:

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
Focus
Focus
DROP
Focus
Focus

Description:

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
Focus
Focus
GAMEOBJECT_DOWN
Focus
Focus

Description:

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
Focus
Focus
GAMEOBJECT_DRAG
Focus
Focus

Description:

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
Focus
Focus
GAMEOBJECT_DRAG_END
Focus
Focus

Description:

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
Focus
Focus
GAMEOBJECT_DRAG_ENTER
Focus
Focus

Description:

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.

Focus
Focus
GAMEOBJECT_DRAG_LEAVE
Focus
Focus

Description:

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.

Focus
Focus
GAMEOBJECT_DRAG_OVER
Focus
Focus

Description:

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.

Focus
Focus
GAMEOBJECT_DRAG_START
Focus
Focus

Description:

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.

Focus
Focus
GAMEOBJECT_DROP
Focus
Focus

Description:

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
Focus
Focus
GAMEOBJECT_MOVE
Focus
Focus

Description:

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
Focus
Focus
GAMEOBJECT_OUT
Focus
Focus

Description:

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
Focus
Focus
GAMEOBJECT_OVER
Focus
Focus

Description:

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
Focus
Focus
GAMEOBJECT_POINTER_DOWN
Focus
Focus

Description:

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.

Focus
Focus
GAMEOBJECT_POINTER_MOVE
Focus
Focus

Description:

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.

Focus
Focus
GAMEOBJECT_POINTER_OUT
Focus
Focus

Description:

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.

Focus
Focus
GAMEOBJECT_POINTER_OVER
Focus
Focus

Description:

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.

Focus
Focus
GAMEOBJECT_POINTER_UP
Focus
Focus

Description:

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.

Focus
Focus
GAMEOBJECT_POINTER_WHEEL
Focus
Focus

Description:

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.

Focus
Focus
GAMEOBJECT_UP
Focus
Focus

Description:

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
Focus
Focus
GAMEOBJECT_WHEEL
Focus
Focus

Description:

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
Focus
Focus
GAME_OUT
Focus
Focus

Description:

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
Focus
Focus
GAME_OVER
Focus
Focus

Description:

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
Focus
Focus
MANAGER_BOOT
Focus
Focus

Description:

The Input Manager Boot Event.

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

Since: 3.0.0
Focus
Focus
MANAGER_PROCESS
Focus
Focus

Description:

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
Focus
Focus
MANAGER_UPDATE
Focus
Focus

Description:

The Input Manager Update Event.

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

Since: 3.0.0
Focus
Focus
POINTERLOCK_CHANGE
Focus
Focus

Description:

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
Focus
Focus
POINTER_DOWN
Focus
Focus

Description:

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
Focus
Focus
POINTER_DOWN_OUTSIDE
Focus
Focus

Description:

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
Focus
Focus
POINTER_MOVE
Focus
Focus

Description:

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
Focus
Focus
POINTER_OUT
Focus
Focus

Description:

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
Focus
Focus
POINTER_OVER
Focus
Focus

Description:

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
Focus
Focus
POINTER_UP
Focus
Focus

Description:

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
Focus
Focus
POINTER_UP_OUTSIDE
Focus
Focus

Description:

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
Focus
Focus
POINTER_WHEEL
Focus
Focus

Description:

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
Focus
Focus
PRE_UPDATE
Focus
Focus

Description:

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
Focus
Focus
SHUTDOWN
Focus
Focus

Description:

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
Focus
Focus
START
Focus
Focus

Description:

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
Focus
Focus
UPDATE
Focus
Focus

Description:

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
Focus
Focus