Interface: InputPluginEventsMap

Phaser.Types.Input. InputPluginEventsMap

Methods


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 17)

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 17)

drag(pointer, gameObject, dragX, dragY)

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 28)

dragend(pointer, gameObject)

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 24)

dragenter(pointer, gameObject, target)

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 27)

dragleave(pointer, gameObject, target)

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 27)

dragover(pointer, gameObject, target)

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 30)

dragstart(pointer, gameObject)

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 26)

drop(pointer, gameObject, target)

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 25)

gameobjectdown(pointer, gameObject, event)

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 37)

gameobjectmove(pointer, gameObject, event)

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 37)

gameobjectout(pointer, gameObject, event)

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 37)

gameobjectover(pointer, gameObject, event)

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 37)

gameobjectup(pointer, gameObject, event)

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 37)

gameobjectwheel(pointer, gameObject, deltaX, deltaY, deltaZ, event)

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 40)

gameout(time, event)

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 23)

gameover(time, event)

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 23)

pointerdown(pointer, currentlyOver)

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 31)

pointerdownoutside(pointer)

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 30)

pointermove(pointer, currentlyOver)

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 31)

pointerout(pointer, justOut)

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 31)

pointerover(pointer, justOver)

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 31)

pointerup(pointer, currentlyOver)

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 31)

pointerupoutside(pointer)

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 30)

preupdate()

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 18)

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 17)

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 18)

update(time, delta)

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 21)

wheel(pointer, currentlyOver, deltaX, deltaY, deltaZ)

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 34)