Classes

Classes

Camera3DPlugin
Class
Bodies
Body
Composite
Constraint
Engine
Vertices
World
Animation
AnimationFrame
AnimationManager
BaseCache
CacheManager
FixedKeyControl
SmoothedKeyControl
BaseCamera
Camera
CameraManager
Fade
Flash
Pan
Shake
Zoom
Camera
CameraManager
OrthographicCamera
PerspectiveCamera
Config
TimeStep
CubicBezier
Curve
Ellipse
Line
MoveTo
Path
QuadraticBezier
Spline
DataManager
DataManagerPlugin
BaseShader
Color
BitmapMask
GeometryMask
RequestAnimationFrame
EventEmitter
FacebookInstantGamesLeaderboard
FacebookInstantGamesPlugin
Game
Arc
BitmapText
Blitter
Bob
Animation
TransformMatrix
Container
Curve
DisplayList
DOMElement
DynamicBitmapText
Ellipse
Extern
GameObject
GameObjectCreator
GameObjectFactory
Graphics
Grid
Group
Image
IsoBox
IsoTriangle
Light
LightsManager
LightsPlugin
Line
Mesh
EmitterOp
GravityWell
Particle
ParticleEmitter
ParticleEmitterManager
DeathZone
EdgeZone
RandomZone
PathFollower
Polygon
Quad
Rectangle
RenderTexture
Shader
Shape
Sprite
Sprite3D
Star
Text
TextStyle
TileSprite
Triangle
UpdateList
Zone
Circle
Ellipse
Line
Point
Polygon
Rectangle
Triangle
Axis
Button
Gamepad
GamepadPlugin
InputManager
InputPlugin
Key
KeyboardManager
KeyboardPlugin
KeyCombo
MouseManager
Pointer
TouchManager
File
AnimationJSONFile
AtlasJSONFile
AtlasXMLFile
AudioFile
AudioSpriteFile
BinaryFile
BitmapFontFile
CSSFile
GLSLFile
HTML5AudioFile
HTMLFile
HTMLTextureFile
ImageFile
JSONFile
MultiAtlasFile
MultiScriptFile
PackFile
PluginFile
SceneFile
ScenePluginFile
ScriptFile
SpriteSheetFile
SVGFile
TextFile
TilemapCSVFile
TilemapImpactFile
TilemapJSONFile
UnityAtlasFile
XMLFile
LoaderPlugin
MultiFile
Matrix3
Matrix4
Quaternion
RandomDataGenerator
Vector2
Vector3
Vector4
ArcadePhysics
Body
Collider
Factory
Group
Image
Sprite
StaticBody
StaticGroup
World
Body
CollisionMap
Factory
ImpactBody
ImpactImage
ImpactPhysics
ImpactSprite
World
Factory
Image
MatterPhysics
PointerConstraint
Sprite
TileBody
World
BasePlugin
PluginManager
ScenePlugin
CanvasRenderer
BitmapMaskPipeline
ForwardDiffuseLightPipeline
TextureTintPipeline
WebGLPipeline
WebGLRenderer
ScaleManager
Scene
SceneManager
ScenePlugin
Systems
BaseSound
BaseSoundManager
HTML5AudioSound
HTML5AudioSoundManager
NoAudioSound
NoAudioSoundManager
WebAudioSound
WebAudioSoundManager
List
Map
ProcessQueue
RTree
Set
Size
CanvasTexture
Frame
Texture
TextureManager
TextureSource
DynamicTilemapLayer
ImageCollection
LayerData
MapData
ObjectLayer
StaticTilemapLayer
Tile
Tilemap
Tileset
Clock
TimerEvent
Timeline
Tween
TweenManager

Namespaces

MatterJS
Phaser
Actions
Animations
Events
BlendModes
Cache
Events
Cameras
Controls
Scene2D
Effects
Events
Sprite3D
Core
Events
Create
Palettes
Curves
Data
Events
Device
Display
Align
In
To
Bounds
Canvas
CanvasInterpolation
CanvasPool
Smoothing
Color
Interpolate
Masks
DOM
Events
GameObjects
Components
Alpha
BlendMode
ComputedSize
Crop
Depth
Flip
GetBounds
Mask
Origin
PathFollower
Pipeline
ScrollFactor
Size
Texture
TextureCrop
Tint
Transform
Visible
Events
Particles
Zones
RetroFont
Geom
Intersects
Input
Events
Gamepad
Configs
Events
InputPluginCache
Keyboard
Events
KeyCodes
Mouse
Touch
Loader
Events
FileTypes
FileTypesManager
Math
Angle
Distance
Easing
Back
Bounce
Circular
Cubic
Elastic
Expo
Linear
Quadratic
Quartic
Quintic
Sine
Stepped
Fuzzy
Interpolation
Pow2
Snap
Physics
Arcade
Components
Acceleration
Angular
Bounce
Debug
Drag
Enable
Friction
Gravity
Immovable
Mass
Size
Velocity
Events
Tilemap
Impact
COLLIDES
Components
Acceleration
BodyScale
BodyType
Bounce
CheckAgainst
Collides
Debug
Friction
Gravity
Offset
SetGameObject
Velocity
Events
TYPE
Matter
Components
Bounce
Collision
Force
Friction
Gravity
Mass
Sensor
SetBody
Sleep
Static
Transform
Velocity
Events
PhysicsEditorParser
Plugins
PluginCache
Renderer
Canvas
Snapshot
WebGL
Pipelines
ModelViewProjection
Utils
Scale
Center
Events
Orientation
ScaleModes
Zoom
ScaleModes
Scenes
Events
Settings
Sound
Events
Structs
Textures
Events
FilterMode
Parsers
Tilemaps
Components
Formats
Parsers
Impact
Tiled
Time
Tweens
Builders
Events
Types
Actions
Animations
Cameras
Controls
Scene2D
Core
Create
Curves
Display
GameObjects
BitmapText
Graphics
Group
Particles
PathFollower
RenderTexture
Sprite
Text
TileSprite
Input
Gamepad
Keyboard
Loader
FileTypes
Math
Physics
Arcade
Impact
Matter
Plugins
Renderer
Snapshot
Scenes
Sound
Textures
Tilemaps
Time
Tweens
Utils
Array
Matrix
StableSortFunctions
Base64
Objects
String

Events


ADD_ANIMATION

The Add Animation Event.

This event is dispatched when a new animation is added to the global Animation Manager.

This can happen either as a result of an animation instance being added to the Animation Manager, or the Animation Manager creating a new animation directly.

Parameters:
Name Type Description
key string

The key of the Animation that was added to the global Animation Manager.

animation Phaser.Animations.Animation

An instance of the newly created Animation.

Since: 3.0.0
Source: src/animations/events/ADD_ANIMATION_EVENT.js (Line 7)

ANIMATION_COMPLETE

The Animation Complete Event.

This event is dispatched by an Animation instance when it completes, i.e. finishes playing or is manually stopped.

Be careful with the volume of events this could generate. If a group of Sprites all complete the same animation at the same time, this event will invoke its handler for each one of them.

Parameters:
Name Type Description
animation Phaser.Animations.Animation

A reference to the Animation that completed.

frame Phaser.Animations.AnimationFrame

The current Animation Frame that the Animation completed on.

gameObject Phaser.GameObjects.Sprite

A reference to the Game Object on which the animation completed.

Since: 3.16.1
Source: src/animations/events/ANIMATION_COMPLETE_EVENT.js (Line 7)

ANIMATION_REPEAT

The Animation Repeat Event.

This event is dispatched when a currently playing animation repeats.

The event is dispatched directly from the Animation object itself. Which means that listeners bound to this event will be invoked every time the Animation repeats, for every Game Object that may have it.

Parameters:
Name Type Description
animation Phaser.Animations.Animation

A reference to the Animation that repeated.

frame Phaser.Animations.AnimationFrame

The current Animation Frame that the Animation was on when it repeated.

Since: 3.16.1
Source: src/animations/events/ANIMATION_REPEAT_EVENT.js (Line 7)

ANIMATION_RESTART

The Animation Restart Event.

This event is dispatched by an Animation instance when it restarts.

Be careful with the volume of events this could generate. If a group of Sprites all restart the same animation at the same time, this event will invoke its handler for each one of them.

Parameters:
Name Type Description
animation Phaser.Animations.Animation

A reference to the Animation that restarted playing.

frame Phaser.Animations.AnimationFrame

The current Animation Frame that the Animation restarted with.

gameObject Phaser.GameObjects.Sprite

A reference to the Game Object on which the animation restarted playing.

Since: 3.16.1
Source: src/animations/events/ANIMATION_RESTART_EVENT.js (Line 7)

ANIMATION_START

The Animation Start Event.

This event is dispatched by an Animation instance when it starts playing.

Be careful with the volume of events this could generate. If a group of Sprites all play the same animation at the same time, this event will invoke its handler for each one of them.

Parameters:
Name Type Description
animation Phaser.Animations.Animation

A reference to the Animation that started playing.

frame Phaser.Animations.AnimationFrame

The current Animation Frame that the Animation started with.

gameObject Phaser.GameObjects.Sprite

A reference to the Game Object on which the animation started playing.

Since: 3.16.1
Source: src/animations/events/ANIMATION_START_EVENT.js (Line 7)

PAUSE_ALL

The Pause All Animations Event.

This event is dispatched when the global Animation Manager is told to pause.

When this happens all current animations will stop updating, although it doesn't necessarily mean that the game has paused as well.

Since: 3.0.0
Source: src/animations/events/PAUSE_ALL_EVENT.js (Line 7)

REMOVE_ANIMATION

The Remove Animation Event.

This event is dispatched when an animation is removed from the global Animation Manager.

Parameters:
Name Type Description
key string

The key of the Animation that was removed from the global Animation Manager.

animation Phaser.Animations.Animation

An instance of the removed Animation.

Since: 3.0.0
Source: src/animations/events/REMOVE_ANIMATION_EVENT.js (Line 7)

RESUME_ALL

The Resume All Animations Event.

This event is dispatched when the global Animation Manager resumes, having been previously paused.

When this happens all current animations will continue updating again.

Since: 3.0.0
Source: src/animations/events/RESUME_ALL_EVENT.js (Line 7)

SPRITE_ANIMATION_COMPLETE

The Sprite Animation Complete Event.

This event is dispatched by a Sprite when an animation finishes playing on it.

Listen for it on the Sprite using sprite.on('animationcomplete', listener)

This same event is dispatched for all animations. To listen for a specific animation, use the SPRITE_ANIMATION_KEY_COMPLETE event.

Parameters:
Name Type Description
animation Phaser.Animations.Animation

A reference to the Animation that completed.

frame Phaser.Animations.AnimationFrame

The current Animation Frame that the Animation completed on.

gameObject Phaser.GameObjects.Sprite

A reference to the Game Object on which the animation completed.

Since: 3.16.1
Source: src/animations/events/SPRITE_ANIMATION_COMPLETE_EVENT.js (Line 7)

SPRITE_ANIMATION_KEY_COMPLETE

The Sprite Animation Key Complete Event.

This event is dispatched by a Sprite when a specific animation finishes playing on it.

Listen for it on the Sprite using sprite.on('animationcomplete-key', listener) where key is the key of the animation. For example, if you had an animation with the key 'explode' you should listen for animationcomplete-explode.

Parameters:
Name Type Description
animation Phaser.Animations.Animation

A reference to the Animation that completed.

frame Phaser.Animations.AnimationFrame

The current Animation Frame that the Animation completed on.

gameObject Phaser.GameObjects.Sprite

A reference to the Game Object on which the animation completed.

Since: 3.16.1
Source: src/animations/events/SPRITE_ANIMATION_KEY_COMPLETE_EVENT.js (Line 7)

SPRITE_ANIMATION_KEY_REPEAT

The Sprite Animation Key Repeat Event.

This event is dispatched by a Sprite when a specific animation repeats playing on it.

Listen for it on the Sprite using sprite.on('animationrepeat-key', listener) where key is the key of the animation. For example, if you had an animation with the key 'explode' you should listen for animationrepeat-explode.

Parameters:
Name Type Description
animation Phaser.Animations.Animation

A reference to the Animation that is repeating on the Sprite.

frame Phaser.Animations.AnimationFrame

The current Animation Frame that the Animation started with.

repeatCount integer

The number of times the Animation has repeated so far.

gameObject Phaser.GameObjects.Sprite

A reference to the Game Object on which the animation repeated playing.

Since: 3.16.1
Source: src/animations/events/SPRITE_ANIMATION_KEY_REPEAT_EVENT.js (Line 7)

SPRITE_ANIMATION_KEY_RESTART

The Sprite Animation Key Restart Event.

This event is dispatched by a Sprite when a specific animation restarts playing on it.

Listen for it on the Sprite using sprite.on('animationrestart-key', listener) where key is the key of the animation. For example, if you had an animation with the key 'explode' you should listen for animationrestart-explode.

Parameters:
Name Type Description
animation Phaser.Animations.Animation

A reference to the Animation that was restarted on the Sprite.

frame Phaser.Animations.AnimationFrame

The current Animation Frame that the Animation restarted with.

gameObject Phaser.GameObjects.Sprite

A reference to the Game Object on which the animation restarted playing.

Since: 3.16.1
Source: src/animations/events/SPRITE_ANIMATION_KEY_RESTART_EVENT.js (Line 7)

SPRITE_ANIMATION_KEY_START

The Sprite Animation Key Start Event.

This event is dispatched by a Sprite when a specific animation starts playing on it.

Listen for it on the Sprite using sprite.on('animationstart-key', listener) where key is the key of the animation. For example, if you had an animation with the key 'explode' you should listen for animationstart-explode.

Parameters:
Name Type Description
animation Phaser.Animations.Animation

A reference to the Animation that was started on the Sprite.

frame Phaser.Animations.AnimationFrame

The current Animation Frame that the Animation started with.

gameObject Phaser.GameObjects.Sprite

A reference to the Game Object on which the animation started playing.

Since: 3.16.1
Source: src/animations/events/SPRITE_ANIMATION_KEY_START_EVENT.js (Line 7)

SPRITE_ANIMATION_KEY_UPDATE

The Sprite Animation Key Update Event.

This event is dispatched by a Sprite when a specific animation playing on it updates. This happens when the animation changes frame, based on the animation frame rate and other factors like timeScale and delay.

Listen for it on the Sprite using sprite.on('animationupdate-key', listener) where key is the key of the animation. For example, if you had an animation with the key 'explode' you should listen for animationupdate-explode.

Parameters:
Name Type Description
animation Phaser.Animations.Animation

A reference to the Animation that has updated on the Sprite.

frame Phaser.Animations.AnimationFrame

The current Animation Frame of the Animation.

gameObject Phaser.GameObjects.Sprite

A reference to the Game Object on which the animation updated.

Since: 3.16.1
Source: src/animations/events/SPRITE_ANIMATION_KEY_UPDATE_EVENT.js (Line 7)

SPRITE_ANIMATION_REPEAT

The Sprite Animation Repeat Event.

This event is dispatched by a Sprite when an animation repeats playing on it.

Listen for it on the Sprite using sprite.on('animationrepeat', listener)

This same event is dispatched for all animations. To listen for a specific animation, use the SPRITE_ANIMATION_KEY_REPEAT event.

Parameters:
Name Type Description
animation Phaser.Animations.Animation

A reference to the Animation that is repeating on the Sprite.

frame Phaser.Animations.AnimationFrame

The current Animation Frame that the Animation started with.

repeatCount integer

The number of times the Animation has repeated so far.

gameObject Phaser.GameObjects.Sprite

A reference to the Game Object on which the animation repeated playing.

Since: 3.16.1
Source: src/animations/events/SPRITE_ANIMATION_REPEAT_EVENT.js (Line 7)

SPRITE_ANIMATION_RESTART

The Sprite Animation Restart Event.

This event is dispatched by a Sprite when an animation restarts playing on it.

Listen for it on the Sprite using sprite.on('animationrestart', listener)

This same event is dispatched for all animations. To listen for a specific animation, use the SPRITE_ANIMATION_KEY_RESTART event.

Parameters:
Name Type Description
animation Phaser.Animations.Animation

A reference to the Animation that was restarted on the Sprite.

frame Phaser.Animations.AnimationFrame

The current Animation Frame that the Animation restarted with.

gameObject Phaser.GameObjects.Sprite

A reference to the Game Object on which the animation restarted playing.

Since: 3.16.1
Source: src/animations/events/SPRITE_ANIMATION_RESTART_EVENT.js (Line 7)

SPRITE_ANIMATION_START

The Sprite Animation Start Event.

This event is dispatched by a Sprite when an animation starts playing on it.

Listen for it on the Sprite using sprite.on('animationstart', listener)

This same event is dispatched for all animations. To listen for a specific animation, use the SPRITE_ANIMATION_KEY_START event.

Parameters:
Name Type Description
animation Phaser.Animations.Animation

A reference to the Animation that was started on the Sprite.

frame Phaser.Animations.AnimationFrame

The current Animation Frame that the Animation started with.

gameObject Phaser.GameObjects.Sprite

A reference to the Game Object on which the animation started playing.

Since: 3.16.1
Source: src/animations/events/SPRITE_ANIMATION_START_EVENT.js (Line 7)

SPRITE_ANIMATION_UPDATE

The Sprite Animation Update Event.

This event is dispatched by a Sprite when an animation playing on it updates. This happens when the animation changes frame, based on the animation frame rate and other factors like timeScale and delay.

Listen for it on the Sprite using sprite.on('animationupdate', listener)

This same event is dispatched for all animations. To listen for a specific animation, use the SPRITE_ANIMATION_KEY_UPDATE event.

Parameters:
Name Type Description
animation Phaser.Animations.Animation

A reference to the Animation that has updated on the Sprite.

frame Phaser.Animations.AnimationFrame

The current Animation Frame of the Animation.

gameObject Phaser.GameObjects.Sprite

A reference to the Game Object on which the animation updated.

Since: 3.16.1
Source: src/animations/events/SPRITE_ANIMATION_UPDATE_EVENT.js (Line 7)

ADD

The Cache Add Event.

This event is dispatched by any Cache that extends the BaseCache each time a new object is added to it.

Parameters:
Name Type Description
cache Phaser.Cache.BaseCache

The cache to which the object was added.

key string

The key of the object added to the cache.

object *

A reference to the object that was added to the cache.

Since: 3.0.0
Source: src/cache/events/ADD_EVENT.js (Line 7)

REMOVE

The Cache Remove Event.

This event is dispatched by any Cache that extends the BaseCache each time an object is removed from it.

Parameters:
Name Type Description
cache Phaser.Cache.BaseCache

The cache from which the object was removed.

key string

The key of the object removed from the cache.

object *

A reference to the object that was removed from the cache.

Since: 3.0.0
Source: src/cache/events/REMOVE_EVENT.js (Line 7)

DESTROY

The Destroy Camera Event.

This event is dispatched by a Camera instance when it is destroyed by the Camera Manager.

Parameters:
Name Type Description
camera Phaser.Cameras.Scene2D.BaseCamera

The camera that was destroyed.

Since: 3.0.0
Source: src/cameras/2d/events/DESTROY_EVENT.js (Line 7)

FADE_IN_COMPLETE

The Camera Fade In Complete Event.

This event is dispatched by a Camera instance when the Fade In Effect completes.

Listen to it from a Camera instance using Camera.on('camerafadeincomplete', listener).

Parameters:
Name Type Description
camera Phaser.Cameras.Scene2D.Camera

The camera that the effect began on.

effect Phaser.Cameras.Scene2D.Effects.Fade

A reference to the effect instance.

Since: 3.3.0
Source: src/cameras/2d/events/FADE_IN_COMPLETE_EVENT.js (Line 7)

FADE_IN_START

The Camera Fade In Start Event.

This event is dispatched by a Camera instance when the Fade In Effect starts.

Listen to it from a Camera instance using Camera.on('camerafadeinstart', listener).

Parameters:
Name Type Description
camera Phaser.Cameras.Scene2D.Camera

The camera that the effect began on.

effect Phaser.Cameras.Scene2D.Effects.Fade

A reference to the effect instance.

duration integer

The duration of the effect.

red integer

The red color channel value.

green integer

The green color channel value.

blue integer

The blue color channel value.

Since: 3.3.0
Source: src/cameras/2d/events/FADE_IN_START_EVENT.js (Line 7)

FADE_OUT_COMPLETE

The Camera Fade Out Complete Event.

This event is dispatched by a Camera instance when the Fade Out Effect completes.

Listen to it from a Camera instance using Camera.on('camerafadeoutcomplete', listener).

Parameters:
Name Type Description
camera Phaser.Cameras.Scene2D.Camera

The camera that the effect began on.

effect Phaser.Cameras.Scene2D.Effects.Fade

A reference to the effect instance.

Since: 3.3.0
Source: src/cameras/2d/events/FADE_OUT_COMPLETE_EVENT.js (Line 7)

FADE_OUT_START

The Camera Fade Out Start Event.

This event is dispatched by a Camera instance when the Fade Out Effect starts.

Listen to it from a Camera instance using Camera.on('camerafadeoutstart', listener).

Parameters:
Name Type Description
camera Phaser.Cameras.Scene2D.Camera

The camera that the effect began on.

effect Phaser.Cameras.Scene2D.Effects.Fade

A reference to the effect instance.

duration integer

The duration of the effect.

red integer

The red color channel value.

green integer

The green color channel value.

blue integer

The blue color channel value.

Since: 3.3.0
Source: src/cameras/2d/events/FADE_OUT_START_EVENT.js (Line 7)

FLASH_COMPLETE

The Camera Flash Complete Event.

This event is dispatched by a Camera instance when the Flash Effect completes.

Parameters:
Name Type Description
camera Phaser.Cameras.Scene2D.Camera

The camera that the effect began on.

effect Phaser.Cameras.Scene2D.Effects.Flash

A reference to the effect instance.

Since: 3.3.0
Source: src/cameras/2d/events/FLASH_COMPLETE_EVENT.js (Line 7)

FLASH_START

The Camera Flash Start Event.

This event is dispatched by a Camera instance when the Flash Effect starts.

Parameters:
Name Type Description
camera Phaser.Cameras.Scene2D.Camera

The camera that the effect began on.

effect Phaser.Cameras.Scene2D.Effects.Flash

A reference to the effect instance.

duration integer

The duration of the effect.

red integer

The red color channel value.

green integer

The green color channel value.

blue integer

The blue color channel value.

Since: 3.3.0
Source: src/cameras/2d/events/FLASH_START_EVENT.js (Line 7)

PAN_COMPLETE

The Camera Pan Complete Event.

This event is dispatched by a Camera instance when the Pan Effect completes.

Parameters:
Name Type Description
camera Phaser.Cameras.Scene2D.Camera

The camera that the effect began on.

effect Phaser.Cameras.Scene2D.Effects.Pan

A reference to the effect instance.

Since: 3.3.0
Source: src/cameras/2d/events/PAN_COMPLETE_EVENT.js (Line 7)

PAN_START

The Camera Pan Start Event.

This event is dispatched by a Camera instance when the Pan Effect starts.

Parameters:
Name Type Description
camera Phaser.Cameras.Scene2D.Camera

The camera that the effect began on.

effect Phaser.Cameras.Scene2D.Effects.Pan

A reference to the effect instance.

duration integer

The duration of the effect.

x number

The destination scroll x coordinate.

y number

The destination scroll y coordinate.

Since: 3.3.0
Source: src/cameras/2d/events/PAN_START_EVENT.js (Line 7)

POST_RENDER

The Camera Post-Render Event.

This event is dispatched by a Camera instance after is has finished rendering. It is only dispatched if the Camera is rendering to a texture.

Listen to it from a Camera instance using: camera.on('postrender', listener).

Parameters:
Name Type Description
camera Phaser.Cameras.Scene2D.BaseCamera

The camera that has finished rendering to a texture.

Since: 3.0.0
Source: src/cameras/2d/events/POST_RENDER_EVENT.js (Line 7)

PRE_RENDER

The Camera Pre-Render Event.

This event is dispatched by a Camera instance when it is about to render. It is only dispatched if the Camera is rendering to a texture.

Listen to it from a Camera instance using: camera.on('prerender', listener).

Parameters:
Name Type Description
camera Phaser.Cameras.Scene2D.BaseCamera

The camera that is about to render to a texture.

Since: 3.0.0
Source: src/cameras/2d/events/PRE_RENDER_EVENT.js (Line 7)

SHAKE_COMPLETE

The Camera Shake Complete Event.

This event is dispatched by a Camera instance when the Shake Effect completes.

Parameters:
Name Type Description
camera Phaser.Cameras.Scene2D.Camera

The camera that the effect began on.

effect Phaser.Cameras.Scene2D.Effects.Shake

A reference to the effect instance.

Since: 3.3.0
Source: src/cameras/2d/events/SHAKE_COMPLETE_EVENT.js (Line 7)

SHAKE_START

The Camera Shake Start Event.

This event is dispatched by a Camera instance when the Shake Effect starts.

Parameters:
Name Type Description
camera Phaser.Cameras.Scene2D.Camera

The camera that the effect began on.

effect Phaser.Cameras.Scene2D.Effects.Shake

A reference to the effect instance.

duration integer

The duration of the effect.

intensity number

The intensity of the effect.

Since: 3.3.0
Source: src/cameras/2d/events/SHAKE_START_EVENT.js (Line 7)

ZOOM_COMPLETE

The Camera Zoom Complete Event.

This event is dispatched by a Camera instance when the Zoom Effect completes.

Parameters:
Name Type Description
camera Phaser.Cameras.Scene2D.Camera

The camera that the effect began on.

effect Phaser.Cameras.Scene2D.Effects.Zoom

A reference to the effect instance.

Since: 3.3.0
Source: src/cameras/2d/events/ZOOM_COMPLETE_EVENT.js (Line 7)

ZOOM_START

The Camera Zoom Start Event.

This event is dispatched by a Camera instance when the Zoom Effect starts.

Parameters:
Name Type Description
camera Phaser.Cameras.Scene2D.Camera

The camera that the effect began on.

effect Phaser.Cameras.Scene2D.Effects.Zoom

A reference to the effect instance.

duration integer

The duration of the effect.

zoom number

The destination zoom value.

Since: 3.3.0
Source: src/cameras/2d/events/ZOOM_START_EVENT.js (Line 7)

BLUR

The Game Blur Event.

This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded enters a blurred state. The blur event is raised when the window loses focus. This can happen if a user swaps tab, or if they simply remove focus from the browser to another app.

Since: 3.0.0
Source: src/core/events/BLUR_EVENT.js (Line 7)

BOOT

The Game Boot Event.

This event is dispatched when the Phaser Game instance has finished booting, but before it is ready to start running. The global systems use this event to know when to set themselves up, dispatching their own ready events as required.

Since: 3.0.0
Source: src/core/events/BOOT_EVENT.js (Line 7)
Listeners of This Event:

DESTROY

The Game Destroy Event.

This event is dispatched when the game instance has been told to destroy itself. Lots of internal systems listen to this event in order to clear themselves out. Custom plugins and game code should also do the same.

Since: 3.0.0
Source: src/core/events/DESTROY_EVENT.js (Line 7)
Listeners of This Event:

FOCUS

The Game Focus Event.

This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded enters a focused state. The focus event is raised when the window re-gains focus, having previously lost it.

Since: 3.0.0
Source: src/core/events/FOCUS_EVENT.js (Line 7)

HIDDEN

The Game Hidden Event.

This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded enters a hidden state. Only browsers that support the Visibility API will cause this event to be emitted.

In most modern browsers, when the document enters a hidden state, the Request Animation Frame and setTimeout, which control the main game loop, will automatically pause. There is no way to stop this from happening. It is something your game should account for in its own code, should the pause be an issue (i.e. for multiplayer games)

Since: 3.0.0
Source: src/core/events/HIDDEN_EVENT.js (Line 7)

PAUSE

The Game Pause Event.

This event is dispatched when the Game loop enters a paused state, usually as a result of the Visibility Handler.

Since: 3.0.0
Source: src/core/events/PAUSE_EVENT.js (Line 7)

POST_RENDER

The Game Post-Render Event.

This event is dispatched right at the end of the render process.

Every Scene will have rendered and been drawn to the canvas by the time this event is fired. Use it for any last minute post-processing before the next game step begins.

Parameters:
Name Type Description
renderer Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer

A reference to the current renderer being used by the Game instance.

Since: 3.0.0
Source: src/core/events/POST_RENDER_EVENT.js (Line 7)

POST_STEP

The Game Post-Step Event.

This event is dispatched after the Scene Manager has updated. Hook into it from plugins or systems that need to do things before the render starts.

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/core/events/POST_STEP_EVENT.js (Line 7)

PRE_RENDER

The Game Pre-Render Event.

This event is dispatched immediately before any of the Scenes have started to render.

The renderer will already have been initialized this frame, clearing itself and preparing to receive the Scenes for rendering, but it won't have actually drawn anything yet.

Parameters:
Name Type Description
renderer Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer

A reference to the current renderer being used by the Game instance.

Since: 3.0.0
Source: src/core/events/PRE_RENDER_EVENT.js (Line 7)

PRE_STEP

The Game Pre-Step Event.

This event is dispatched before the main Game Step starts. By this point in the game cycle none of the Scene updates have yet happened. Hook into it from plugins or systems that need to update before the Scene Manager does.

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/core/events/PRE_STEP_EVENT.js (Line 7)

READY

The Game Ready Event.

This event is dispatched when the Phaser Game instance has finished booting, the Texture Manager is fully ready, and all local systems are now able to start.

Since: 3.0.0
Source: src/core/events/READY_EVENT.js (Line 7)

RESUME

The Game Resume Event.

This event is dispatched when the game loop leaves a paused state and resumes running.

Since: 3.0.0
Source: src/core/events/RESUME_EVENT.js (Line 7)

STEP

The Game Step Event.

This event is dispatched after the Game Pre-Step and before the Scene Manager steps. Hook into it from plugins or systems that need to update before the Scene Manager does, but after the core Systems have.

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/core/events/STEP_EVENT.js (Line 7)

VISIBLE

The Game Visible Event.

This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded enters a visible state, previously having been hidden.

Only browsers that support the Visibility API will cause this event to be emitted.

Since: 3.0.0
Source: src/core/events/VISIBLE_EVENT.js (Line 7)

CHANGE_DATA

The Change Data Event.

This event is dispatched by a Data Manager when an item in the data store is changed.

Game Objects with data enabled have an instance of a Data Manager under the data property. So, to listen for a change data event from a Game Object you would use: sprite.data.on('changedata', listener).

This event is dispatched for all items that change in the Data Manager. To listen for the change of a specific item, use the CHANGE_DATA_KEY_EVENT event.

Parameters:
Name Type Description
parent any

A reference to the object that the Data Manager responsible for this event belongs to.

key string

The unique key of the data item within the Data Manager.

value any

The new value of the item in the Data Manager.

previousValue any

The previous value of the item in the Data Manager.

Since: 3.0.0
Source: src/data/events/CHANGE_DATA_EVENT.js (Line 7)

CHANGE_DATA_KEY

The Change Data Key Event.

This event is dispatched by a Data Manager when an item in the data store is changed.

Game Objects with data enabled have an instance of a Data Manager under the data property. So, to listen for the change of a specific data item from a Game Object you would use: sprite.data.on('changedata-key', listener), where key is the unique string key of the data item. For example, if you have a data item stored called gold then you can listen for sprite.data.on('changedata-gold').

Parameters:
Name Type Description
parent any

A reference to the object that owns the instance of the Data Manager responsible for this event.

key string

The unique key of the data item within the Data Manager.

value any

The item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.

previousValue any

The previous item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.

Since: 3.16.1
Source: src/data/events/CHANGE_DATA_KEY_EVENT.js (Line 7)

REMOVE_DATA

The Remove Data Event.

This event is dispatched by a Data Manager when an item is removed from it.

Game Objects with data enabled have an instance of a Data Manager under the data property. So, to listen for the removal of a data item on a Game Object you would use: sprite.data.on('removedata', listener).

Parameters:
Name Type Description
parent any

A reference to the object that owns the instance of the Data Manager responsible for this event.

key string

The unique key of the data item within the Data Manager.

data any

The item that was removed from the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.

Since: 3.0.0
Source: src/data/events/REMOVE_DATA_EVENT.js (Line 7)

SET_DATA

The Set Data Event.

This event is dispatched by a Data Manager when a new item is added to the data store.

Game Objects with data enabled have an instance of a Data Manager under the data property. So, to listen for the addition of a new data item on a Game Object you would use: sprite.data.on('setdata', listener).

Parameters:
Name Type Description
parent any

A reference to the object that owns the instance of the Data Manager responsible for this event.

key string

The unique key of the data item within the Data Manager.

data any

The item that was added to the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.

Since: 3.0.0
Source: src/data/events/SET_DATA_EVENT.js (Line 7)

DESTROY

The Game Object Destroy Event.

This event is dispatched when a Game Object instance is being destroyed.

Listen for it on a Game Object instance using GameObject.on('destroy', listener).

Parameters:
Name Type Description
gameObject Phaser.GameObjects.GameObject

The Game Object which is being destroyed.

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

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('pointerup', 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)

BUTTON_DOWN

The Gamepad Button Down Event.

This event is dispatched by the Gamepad Plugin when a button has been pressed on any active Gamepad.

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

You can also listen for a DOWN event from a Gamepad instance. See the GAMEPAD_BUTTON_DOWN event for details.

Parameters:
Name Type Description
pad Phaser.Input.Gamepad

A reference to the Gamepad on which the button was pressed.

button Phaser.Input.Gamepad.Button

A reference to the Button which was pressed.

value number

The value of the button at the time it was pressed. Between 0 and 1. Some Gamepads have pressure-sensitive buttons.

Since: 3.10.0
Source: src/input/gamepad/events/BUTTON_DOWN_EVENT.js (Line 7)

BUTTON_UP

The Gamepad Button Up Event.

This event is dispatched by the Gamepad Plugin when a button has been released on any active Gamepad.

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

You can also listen for an UP event from a Gamepad instance. See the GAMEPAD_BUTTON_UP event for details.

Parameters:
Name Type Description
pad Phaser.Input.Gamepad

A reference to the Gamepad on which the button was released.

button Phaser.Input.Gamepad.Button

A reference to the Button which was released.

value number

The value of the button at the time it was released. Between 0 and 1. Some Gamepads have pressure-sensitive buttons.

Since: 3.10.0
Source: src/input/gamepad/events/BUTTON_UP_EVENT.js (Line 7)

CONNECTED

The Gamepad Connected Event.

This event is dispatched by the Gamepad Plugin when a Gamepad has been connected.

Listen to this event from within a Scene using: this.input.gamepad.once('connected', listener).

Note that the browser may require you to press a button on a gamepad before it will allow you to access it, this is for security reasons. However, it may also trust the page already, in which case you won't get the 'connected' event and instead should check GamepadPlugin.total to see if it thinks there are any gamepads already connected.

Parameters:
Name Type Description
pad Phaser.Input.Gamepad

A reference to the Gamepad which was connected.

event Event

The native DOM Event that triggered the connection.

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

DISCONNECTED

The Gamepad Disconnected Event.

This event is dispatched by the Gamepad Plugin when a Gamepad has been disconnected.

Listen to this event from within a Scene using: this.input.gamepad.once('disconnected', listener).

Parameters:
Name Type Description
pad Phaser.Input.Gamepad

A reference to the Gamepad which was disconnected.

event Event

The native DOM Event that triggered the disconnection.

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

GAMEPAD_BUTTON_DOWN

The Gamepad Button Down Event.

This event is dispatched by a Gamepad instance when a button has been pressed on it.

Listen to this event from a Gamepad instance. Once way to get this is from the pad1, pad2, etc properties on the Gamepad Plugin: this.input.gamepad.pad1.on('down', listener).

Note that you will not receive any Gamepad button events until the browser considers the Gamepad as being 'connected'.

You can also listen for a DOWN event from the Gamepad Plugin. See the BUTTON_DOWN event for details.

Parameters:
Name Type Description
index integer

The index of the button that was pressed.

value number

The value of the button at the time it was pressed. Between 0 and 1. Some Gamepads have pressure-sensitive buttons.

button Phaser.Input.Gamepad.Button

A reference to the Button which was pressed.

Since: 3.10.0
Source: src/input/gamepad/events/GAMEPAD_BUTTON_DOWN_EVENT.js (Line 7)

GAMEPAD_BUTTON_UP

The Gamepad Button Up Event.

This event is dispatched by a Gamepad instance when a button has been released on it.

Listen to this event from a Gamepad instance. Once way to get this is from the pad1, pad2, etc properties on the Gamepad Plugin: this.input.gamepad.pad1.on('up', listener).

Note that you will not receive any Gamepad button events until the browser considers the Gamepad as being 'connected'.

You can also listen for an UP event from the Gamepad Plugin. See the BUTTON_UP event for details.

Parameters:
Name Type Description
index integer

The index of the button that was released.

value number

The value of the button at the time it was released. Between 0 and 1. Some Gamepads have pressure-sensitive buttons.

button Phaser.Input.Gamepad.Button

A reference to the Button which was released.

Since: 3.10.0
Source: src/input/gamepad/events/GAMEPAD_BUTTON_UP_EVENT.js (Line 7)

ANY_KEY_DOWN

The Global Key Down Event.

This event is dispatched by the Keyboard Plugin when any key on the keyboard is pressed down.

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

You can also listen for a specific key being pressed. See Keyboard.Events.KEY_DOWN for details.

Finally, you can create Key objects, which you can also listen for events from. See Keyboard.Events.DOWN for details.

Note: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting. Read this article on ghosting for details.

Also, please be aware that some browser extensions can disable or override Phaser keyboard handling. For example, the Chrome extension vimium is known to disable Phaser from using the D key, while EverNote disables the backtick key. There are others. So, please check your extensions if you find you have specific keys that don't work.

Parameters:
Name Type Description
event KeyboardEvent

The native DOM Keyboard Event. You can inspect this to learn more about the key that was pressed, any modifiers, etc.

Since: 3.0.0
Source: src/input/keyboard/events/ANY_KEY_DOWN_EVENT.js (Line 7)
Listeners of This Event:

ANY_KEY_UP

The Global Key Up Event.

This event is dispatched by the Keyboard Plugin when any key on the keyboard is released.

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

You can also listen for a specific key being released. See Keyboard.Events.KEY_UP for details.

Finally, you can create Key objects, which you can also listen for events from. See Keyboard.Events.UP for details.

Parameters:
Name Type Description
event KeyboardEvent

The native DOM Keyboard Event. You can inspect this to learn more about the key that was released, any modifiers, etc.

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

COMBO_MATCH

The Key Combo Match Event.

This event is dispatched by the Keyboard Plugin when a Key Combo is matched.

Listen for this event from the Key Plugin after a combo has been created:

this.input.keyboard.createCombo([ 38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13 ], { resetOnMatch: true });

this.input.keyboard.on('keycombomatch', function (event) {
    console.log('Konami Code entered!');
});
Parameters:
Name Type Description
keycombo Phaser.Input.Keyboard.KeyCombo

The Key Combo object that was matched.

event KeyboardEvent

The native DOM Keyboard Event of the final key in the combo. You can inspect this to learn more about any modifiers, etc.

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

DOWN

The Key Down Event.

This event is dispatched by a Key object when it is pressed.

Listen for this event from the Key object instance directly:

var spaceBar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE);

spaceBar.on('down', listener)

You can also create a generic 'global' listener. See Keyboard.Events.ANY_KEY_DOWN for details.

Parameters:
Name Type Description
key Phaser.Input.Keyboard.Key

The Key object that was pressed.

event KeyboardEvent

The native DOM Keyboard Event. You can inspect this to learn more about any modifiers, etc.

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

KEY_DOWN

The Key Down Event.

This event is dispatched by the Keyboard Plugin when any key on the keyboard is pressed down.

Unlike the ANY_KEY_DOWN event, this one has a special dynamic event name. For example, to listen for the A key being pressed use the following from within a Scene: this.input.keyboard.on('keydown-A', listener). You can replace the -A part of the event name with any valid Key Code string. For example, this will listen for the space bar: this.input.keyboard.on('keydown-SPACE', listener).

You can also create a generic 'global' listener. See Keyboard.Events.ANY_KEY_DOWN for details.

Finally, you can create Key objects, which you can also listen for events from. See Keyboard.Events.DOWN for details.

Note: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting. Read this article on ghosting for details.

Also, please be aware that some browser extensions can disable or override Phaser keyboard handling. For example, the Chrome extension vimium is known to disable Phaser from using the D key, while EverNote disables the backtick key. There are others. So, please check your extensions if you find you have specific keys that don't work.

Parameters:
Name Type Description
event KeyboardEvent

The native DOM Keyboard Event. You can inspect this to learn more about the key that was pressed, any modifiers, etc.

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

KEY_UP

The Key Up Event.

This event is dispatched by the Keyboard Plugin when any key on the keyboard is released.

Unlike the ANY_KEY_UP event, this one has a special dynamic event name. For example, to listen for the A key being released use the following from within a Scene: this.input.keyboard.on('keyup-A', listener). You can replace the -A part of the event name with any valid Key Code string. For example, this will listen for the space bar: this.input.keyboard.on('keyup-SPACE', listener).

You can also create a generic 'global' listener. See Keyboard.Events.ANY_KEY_UP for details.

Finally, you can create Key objects, which you can also listen for events from. See Keyboard.Events.UP for details.

Parameters:
Name Type Description
event KeyboardEvent

The native DOM Keyboard Event. You can inspect this to learn more about the key that was released, any modifiers, etc.

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

UP

The Key Up Event.

This event is dispatched by a Key object when it is released.

Listen for this event from the Key object instance directly:

var spaceBar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE);

spaceBar.on('up', listener)

You can also create a generic 'global' listener. See Keyboard.Events.ANY_KEY_UP for details.

Parameters:
Name Type Description
key Phaser.Input.Keyboard.Key

The Key object that was released.

event KeyboardEvent

The native DOM Keyboard Event. You can inspect this to learn more about any modifiers, etc.

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

ADD

The Loader Plugin Add File Event.

This event is dispatched when a new file is successfully added to the Loader and placed into the load queue.

Listen to it from a Scene using: this.load.on('addfile', listener).

If you add lots of files to a Loader from a preload method, it will dispatch this event for each one of them.

Parameters:
Name Type Description
key string

The unique key of the file that was added to the Loader.

type string

The file type string of the file that was added to the Loader, i.e. image.

loader Phaser.Loader.LoaderPlugin

A reference to the Loader Plugin that dispatched this event.

file Phaser.Loader.File

A reference to the File which was added to the Loader.

Since: 3.0.0
Source: src/loader/events/ADD_EVENT.js (Line 7)

COMPLETE

The Loader Plugin Complete Event.

This event is dispatched when the Loader has fully processed everything in the load queue. By this point every loaded file will now be in its associated cache and ready for use.

Listen to it from a Scene using: this.load.on('complete', listener).

Parameters:
Name Type Description
loader Phaser.Loader.LoaderPlugin

A reference to the Loader Plugin that dispatched this event.

totalComplete integer

The total number of files that successfully loaded.

totalFailed integer

The total number of files that failed to load.

Since: 3.0.0
Source: src/loader/events/COMPLETE_EVENT.js (Line 7)

FILE_COMPLETE

The File Load Complete Event.

This event is dispatched by the Loader Plugin when any file in the queue finishes loading.

Listen to it from a Scene using: this.load.on('filecomplete', listener).

You can also listen for the completion of a specific file. See the FILE_KEY_COMPLETE event.

Parameters:
Name Type Description
key string

The key of the file that just loaded and finished processing.

type string

The file type of the file that just loaded, i.e. image.

data any

The raw data the file contained.

Since: 3.0.0
Source: src/loader/events/FILE_COMPLETE_EVENT.js (Line 7)

FILE_KEY_COMPLETE

The File Load Complete Event.

This event is dispatched by the Loader Plugin when any file in the queue finishes loading.

It uses a special dynamic event name constructed from the key and type of the file.

For example, if you have loaded an image with a key of monster, you can listen for it using the following:

this.load.on('filecomplete-image-monster', function (key, type, data) {
    // Your handler code
});

Or, if you have loaded a texture atlas with a key of Level1:

this.load.on('filecomplete-atlas-Level1', function (key, type, data) {
    // Your handler code
});

Or, if you have loaded a sprite sheet with a key of Explosion and a prefix of GAMEOVER:

this.load.on('filecomplete-spritesheet-GAMEOVERExplosion', function (key, type, data) {
    // Your handler code
});

You can also listen for the generic completion of files. See the FILE_COMPLETE event.

Parameters:
Name Type Description
key string

The key of the file that just loaded and finished processing.

type string

The file type of the file that just loaded, i.e. image.

data any

The raw data the file contained.

Since: 3.0.0
Source: src/loader/events/FILE_KEY_COMPLETE_EVENT.js (Line 7)

FILE_LOAD

The File Load Event.

This event is dispatched by the Loader Plugin when a file finishes loading, but before it is processed and added to the internal Phaser caches.

Listen to it from a Scene using: this.load.on('load', listener).

Parameters:
Name Type Description
file Phaser.Loader.File

A reference to the File which just finished loading.

Since: 3.0.0
Source: src/loader/events/FILE_LOAD_EVENT.js (Line 7)

FILE_LOAD_ERROR

The File Load Error Event.

This event is dispatched by the Loader Plugin when a file fails to load.

Listen to it from a Scene using: this.load.on('loaderror', listener).

Parameters:
Name Type Description
file Phaser.Loader.File

A reference to the File which errored during load.

Since: 3.0.0
Source: src/loader/events/FILE_LOAD_ERROR_EVENT.js (Line 7)

FILE_PROGRESS

The File Load Progress Event.

This event is dispatched by the Loader Plugin during the load of a file, if the browser receives a DOM ProgressEvent and the lengthComputable event property is true. Depending on the size of the file and browser in use, this may, or may not happen.

Listen to it from a Scene using: this.load.on('fileprogress', listener).

Parameters:
Name Type Description
file Phaser.Loader.File

A reference to the File which errored during load.

percentComplete number

A value between 0 and 1 indicating how 'complete' this file is.

Since: 3.0.0
Source: src/loader/events/FILE_PROGRESS_EVENT.js (Line 7)

POST_PROCESS

The Loader Plugin Post Process Event.

This event is dispatched by the Loader Plugin when the Loader has finished loading everything in the load queue. It is dispatched before the internal lists are cleared and each File is destroyed.

Use this hook to perform any last minute processing of files that can only happen once the Loader has completed, but prior to it emitting the complete event.

Listen to it from a Scene using: this.load.on('postprocess', listener).

Parameters:
Name Type Description
loader Phaser.Loader.LoaderPlugin

A reference to the Loader Plugin that dispatched this event.

Since: 3.0.0
Source: src/loader/events/POST_PROCESS_EVENT.js (Line 7)

PROGRESS

The Loader Plugin Progress Event.

This event is dispatched when the Loader updates its load progress, typically as a result of a file having completed loading.

Listen to it from a Scene using: this.load.on('progress', listener).

Parameters:
Name Type Description
progress number

The current progress of the load. A value between 0 and 1.

Since: 3.0.0
Source: src/loader/events/PROGRESS_EVENT.js (Line 7)

START

The Loader Plugin Start Event.

This event is dispatched when the Loader starts running. At this point load progress is zero.

This event is dispatched even if there aren't any files in the load queue.

Listen to it from a Scene using: this.load.on('start', listener).

Parameters:
Name Type Description
loader Phaser.Loader.LoaderPlugin

A reference to the Loader Plugin that dispatched this event.

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

COLLIDE

The Arcade Physics World Collide Event.

This event is dispatched by an Arcade Physics World instance if two bodies collide and at least one of them has their onCollide property set to true.

It provides an alternative means to handling collide events rather than using the callback approach.

Listen to it from a Scene using: this.physics.world.on('collide', listener).

Please note that 'collide' and 'overlap' are two different things in Arcade Physics.

Parameters:
Name Type Description
gameObject1 Phaser.GameObjects.GameObject

The first Game Object involved in the collision. This is the parent of body1.

gameObject2 Phaser.GameObjects.GameObject

The second Game Object involved in the collision. This is the parent of body2.

body1 Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody

The first Physics Body involved in the collision.

body2 Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody

The second Physics Body involved in the collision.

Since: 3.0.0
Source: src/physics/arcade/events/COLLIDE_EVENT.js (Line 7)

OVERLAP

The Arcade Physics World Overlap Event.

This event is dispatched by an Arcade Physics World instance if two bodies overlap and at least one of them has their onOverlap property set to true.

It provides an alternative means to handling overlap events rather than using the callback approach.

Listen to it from a Scene using: this.physics.world.on('overlap', listener).

Please note that 'collide' and 'overlap' are two different things in Arcade Physics.

Parameters:
Name Type Description
gameObject1 Phaser.GameObjects.GameObject

The first Game Object involved in the overlap. This is the parent of body1.

gameObject2 Phaser.GameObjects.GameObject

The second Game Object involved in the overlap. This is the parent of body2.

body1 Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody

The first Physics Body involved in the overlap.

body2 Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody

The second Physics Body involved in the overlap.

Since: 3.0.0
Source: src/physics/arcade/events/OVERLAP_EVENT.js (Line 7)

PAUSE

The Arcade Physics World Pause Event.

This event is dispatched by an Arcade Physics World instance when it is paused.

Listen to it from a Scene using: this.physics.world.on('pause', listener).

Since: 3.0.0
Source: src/physics/arcade/events/PAUSE_EVENT.js (Line 7)

RESUME

The Arcade Physics World Resume Event.

This event is dispatched by an Arcade Physics World instance when it resumes from a paused state.

Listen to it from a Scene using: this.physics.world.on('resume', listener).

Since: 3.0.0
Source: src/physics/arcade/events/RESUME_EVENT.js (Line 7)

TILE_COLLIDE

The Arcade Physics Tile Collide Event.

This event is dispatched by an Arcade Physics World instance if a body collides with a Tile and has its onCollide property set to true.

It provides an alternative means to handling collide events rather than using the callback approach.

Listen to it from a Scene using: this.physics.world.on('tilecollide', listener).

Please note that 'collide' and 'overlap' are two different things in Arcade Physics.

Parameters:
Name Type Description
gameObject Phaser.GameObjects.GameObject

The Game Object involved in the collision. This is the parent of body.

tile Phaser.Tilemaps.Tile

The tile the body collided with.

body Phaser.Physics.Arcade.Body

The Arcade Physics Body of the Game Object involved in the collision.

Since: 3.16.1
Source: src/physics/arcade/events/TILE_COLLIDE_EVENT.js (Line 7)

TILE_OVERLAP

The Arcade Physics Tile Overlap Event.

This event is dispatched by an Arcade Physics World instance if a body overlaps with a Tile and has its onOverlap property set to true.

It provides an alternative means to handling overlap events rather than using the callback approach.

Listen to it from a Scene using: this.physics.world.on('tileoverlap', listener).

Please note that 'collide' and 'overlap' are two different things in Arcade Physics.

Parameters:
Name Type Description
gameObject Phaser.GameObjects.GameObject

The Game Object involved in the overlap. This is the parent of body.

tile Phaser.Tilemaps.Tile

The tile the body overlapped.

body Phaser.Physics.Arcade.Body

The Arcade Physics Body of the Game Object involved in the overlap.

Since: 3.16.1
Source: src/physics/arcade/events/TILE_OVERLAP_EVENT.js (Line 7)

WORLD_BOUNDS

The Arcade Physics World Bounds Event.

This event is dispatched by an Arcade Physics World instance if a body makes contact with the world bounds and it has its onWorldBounds property set to true.

It provides an alternative means to handling collide events rather than using the callback approach.

Listen to it from a Scene using: this.physics.world.on('worldbounds', listener).

Parameters:
Name Type Description
body Phaser.Physics.Arcade.Body

The Arcade Physics Body that hit the world bounds.

up boolean

Is the Body blocked up? I.e. collided with the top of the world bounds.

down boolean

Is the Body blocked down? I.e. collided with the bottom of the world bounds.

left boolean

Is the Body blocked left? I.e. collided with the left of the world bounds.

right boolean

Is the Body blocked right? I.e. collided with the right of the world bounds.

Since: 3.0.0
Source: src/physics/arcade/events/WORLD_BOUNDS_EVENT.js (Line 7)

WORLD_STEP

The Arcade Physics World Step Event.

This event is dispatched by an Arcade Physics World instance whenever a physics step is run. It is emitted after the bodies and colliders have been updated.

In high framerate settings this can be multiple times per game frame.

Listen to it from a Scene using: this.physics.world.on('worldstep', listener).

Since: 3.18.0
Source: src/physics/arcade/events/WORLD_STEP_EVENT.js (Line 7)

COLLIDE

The Impact Physics World Collide Event.

This event is dispatched by an Impact Physics World instance if two bodies collide.

Listen to it from a Scene using: this.impact.world.on('collide', listener).

Parameters:
Name Type Description
bodyA Phaser.Physics.Impact.Body

The first body involved in the collision.

bodyB Phaser.Physics.Impact.Body

The second body involved in the collision.

axis string

The collision axis. Either x or y.

Since: 3.0.0
Source: src/physics/impact/events/COLLIDE_EVENT.js (Line 7)

PAUSE

The Impact Physics World Pause Event.

This event is dispatched by an Impact Physics World instance when it is paused.

Listen to it from a Scene using: this.impact.world.on('pause', listener).

Since: 3.0.0
Source: src/physics/impact/events/PAUSE_EVENT.js (Line 7)

RESUME

The Impact Physics World Resume Event.

This event is dispatched by an Impact Physics World instance when it resumes from a paused state.

Listen to it from a Scene using: this.impact.world.on('resume', listener).

Since: 3.0.0
Source: src/physics/impact/events/RESUME_EVENT.js (Line 7)

AFTER_UPDATE

The Matter Physics After Update Event.

This event is dispatched by a Matter Physics World instance after the engine has updated and all collision events have resolved.

Listen to it from a Scene using: this.matter.world.on('afterupdate', listener).

Parameters:
Name Type Description
event Phaser.Physics.Matter.Events.AfterUpdateEvent

The Update Event object.

Since: 3.0.0
Source: src/physics/matter-js/events/AFTER_UPDATE_EVENT.js (Line 15)

BEFORE_UPDATE

The Matter Physics Before Update Event.

This event is dispatched by a Matter Physics World instance right before all the collision processing takes place.

Listen to it from a Scene using: this.matter.world.on('beforeupdate', listener).

Parameters:
Name Type Description
event Phaser.Physics.Matter.Events.BeforeUpdateEvent

The Update Event object.

Since: 3.0.0
Source: src/physics/matter-js/events/BEFORE_UPDATE_EVENT.js (Line 15)

COLLISION_ACTIVE

The Matter Physics Collision Active Event.

This event is dispatched by a Matter Physics World instance after the engine has updated. It provides a list of all pairs that are colliding in the current tick (if any).

Listen to it from a Scene using: this.matter.world.on('collisionactive', listener).

Parameters:
Name Type Description
event Phaser.Physics.Matter.Events.CollisionActiveEvent

The Collision Event object.

bodyA MatterJS.Body

The first body of the first colliding pair. The event.pairs array may contain more colliding bodies.

bodyB MatterJS.Body

The second body of the first colliding pair. The event.pairs array may contain more colliding bodies.

Since: 3.0.0
Source: src/physics/matter-js/events/COLLISION_ACTIVE_EVENT.js (Line 16)

COLLISION_END

The Matter Physics Collision End Event.

This event is dispatched by a Matter Physics World instance after the engine has updated. It provides a list of all pairs that have finished colliding in the current tick (if any).

Listen to it from a Scene using: this.matter.world.on('collisionend', listener).

Parameters:
Name Type Description
event Phaser.Physics.Matter.Events.CollisionEndEvent

The Collision Event object.

bodyA MatterJS.Body

The first body of the first colliding pair. The event.pairs array may contain more colliding bodies.

bodyB MatterJS.Body

The second body of the first colliding pair. The event.pairs array may contain more colliding bodies.

Since: 3.0.0
Source: src/physics/matter-js/events/COLLISION_END_EVENT.js (Line 16)

COLLISION_START

The Matter Physics Collision Start Event.

This event is dispatched by a Matter Physics World instance after the engine has updated. It provides a list of all pairs that have started to collide in the current tick (if any).

Listen to it from a Scene using: this.matter.world.on('collisionstart', listener).

Parameters:
Name Type Description
event Phaser.Physics.Matter.Events.CollisionStartEvent

The Collision Event object.

bodyA MatterJS.Body

The first body of the first colliding pair. The event.pairs array may contain more colliding bodies.

bodyB MatterJS.Body

The second body of the first colliding pair. The event.pairs array may contain more colliding bodies.

Since: 3.0.0
Source: src/physics/matter-js/events/COLLISION_START_EVENT.js (Line 16)

DRAG

The Matter Physics Drag Event.

This event is dispatched by a Matter Physics World instance when a Pointer Constraint is actively dragging a body. It is emitted each time the pointer moves.

Listen to it from a Scene using: this.matter.world.on('drag', listener).

Parameters:
Name Type Description
body MatterJS.Body

The Body that is being dragged. This is a Matter Body, not a Phaser Game Object.

constraint Phaser.Physics.Matter.PointerConstraint

The Pointer Constraint that is dragging the body.

Since: 3.16.2
Source: src/physics/matter-js/events/DRAG_EVENT.js (Line 7)

DRAG_END

The Matter Physics Drag End Event.

This event is dispatched by a Matter Physics World instance when a Pointer Constraint stops dragging a body.

Listen to it from a Scene using: this.matter.world.on('dragend', listener).

Parameters:
Name Type Description
body MatterJS.Body

The Body that has stopped being dragged. This is a Matter Body, not a Phaser Game Object.

constraint Phaser.Physics.Matter.PointerConstraint

The Pointer Constraint that was dragging the body.

Since: 3.16.2
Source: src/physics/matter-js/events/DRAG_END_EVENT.js (Line 7)

DRAG_START

The Matter Physics Drag Start Event.

This event is dispatched by a Matter Physics World instance when a Pointer Constraint starts dragging a body.

Listen to it from a Scene using: this.matter.world.on('dragstart', listener).

Parameters:
Name Type Description
body MatterJS.Body

The Body that has started being dragged. This is a Matter Body, not a Phaser Game Object.

part MatterJS.Body

The part of the body that was clicked on.

constraint Phaser.Physics.Matter.PointerConstraint

The Pointer Constraint that is dragging the body.

Since: 3.16.2
Source: src/physics/matter-js/events/DRAG_START_EVENT.js (Line 7)

PAUSE

The Matter Physics World Pause Event.

This event is dispatched by an Matter Physics World instance when it is paused.

Listen to it from a Scene using: this.matter.world.on('pause', listener).

Since: 3.0.0
Source: src/physics/matter-js/events/PAUSE_EVENT.js (Line 7)

RESUME

The Matter Physics World Resume Event.

This event is dispatched by an Matter Physics World instance when it resumes from a paused state.

Listen to it from a Scene using: this.matter.world.on('resume', listener).

Since: 3.0.0
Source: src/physics/matter-js/events/RESUME_EVENT.js (Line 7)

SLEEP_END

The Matter Physics Sleep End Event.

This event is dispatched by a Matter Physics World instance when a Body stop sleeping.

Listen to it from a Scene using: this.matter.world.on('sleepend', listener).

Parameters:
Name Type Description
event Phaser.Physics.Matter.Events.SleepEndEvent

The Sleep Event object.

body MatterJS.Body

The body that has stopped sleeping.

Since: 3.0.0
Source: src/physics/matter-js/events/SLEEP_END_EVENT.js (Line 14)

SLEEP_START

The Matter Physics Sleep Start Event.

This event is dispatched by a Matter Physics World instance when a Body goes to sleep.

Listen to it from a Scene using: this.matter.world.on('sleepstart', listener).

Parameters:
Name Type Description
event Phaser.Physics.Matter.Events.SleepStartEvent

The Sleep Event object.

body MatterJS.Body

The body that has gone to sleep.

Since: 3.0.0
Source: src/physics/matter-js/events/SLEEP_START_EVENT.js (Line 14)

ENTER_FULLSCREEN

The Scale Manager has successfully entered fullscreen mode.

Since: 3.16.1
Source: src/scale/events/ENTER_FULLSCREEN_EVENT.js (Line 7)

FULLSCREEN_FAILED

The Scale Manager tried to enter fullscreen mode but failed.

Since: 3.17.0
Source: src/scale/events/FULLSCREEN_FAILED_EVENT.js (Line 7)

FULLSCREEN_UNSUPPORTED

The Scale Manager tried to enter fullscreen mode, but it is unsupported by the browser.

Since: 3.16.1
Source: src/scale/events/FULLSCREEN_UNSUPPORTED_EVENT.js (Line 7)

LEAVE_FULLSCREEN

The Scale Manager was in fullscreen mode, but has since left, either directly via game code, or via a user gestured, such as pressing the ESC key.

Since: 3.16.1
Source: src/scale/events/LEAVE_FULLSCREEN_EVENT.js (Line 7)

ORIENTATION_CHANGE

The Scale Manager Orientation Change Event.

Parameters:
Name Type Description
orientation string

-

Since: 3.16.1
Source: src/scale/events/ORIENTATION_CHANGE_EVENT.js (Line 7)

RESIZE

The Scale Manager Resize Event.

This event is dispatched whenever the Scale Manager detects a resize event from the browser. It sends three parameters to the callback, each of them being Size components. You can read the width, height, aspectRatio and other properties of these components to help with scaling your own game content.

Parameters:
Name Type Description
gameSize Phaser.Structs.Size

A reference to the Game Size component. This is the un-scaled size of your game canvas.

baseSize Phaser.Structs.Size

A reference to the Base Size component. This is the game size multiplied by resolution.

displaySize Phaser.Structs.Size

A reference to the Display Size component. This is the scaled canvas size, after applying zoom and scale mode.

resolution number

The current resolution. Defaults to 1 at the moment.

previousWidth number

If the gameSize has changed, this value contains its previous width, otherwise it contains the current width.

previousHeight number

If the gameSize has changed, this value contains its previous height, otherwise it contains the current height.

Since: 3.16.1
Source: src/scale/events/RESIZE_EVENT.js (Line 7)

BOOT

The Scene Systems Boot Event.

This event is dispatched by a Scene during the Scene Systems boot process. Primarily used by Scene Plugins.

Listen to it from a Scene using this.scene.events.on('boot', listener).

Parameters:
Name Type Description
sys Phaser.Scenes.Systems

A reference to the Scene Systems class of the Scene that emitted this event.

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

CREATE

The Scene Create Event.

This event is dispatched by a Scene after it has been created by the Scene Manager.

If a Scene has a create method then this event is emitted after that has run.

If there is a transition, this event will be fired after the TRANSITION_START event.

Listen to it from a Scene using this.scene.events.on('create', listener).

Parameters:
Name Type Description
scene Phaser.Scene

A reference to the Scene that emitted this event.

Since: 3.17.0
Source: src/scene/events/CREATE_EVENT.js (Line 7)

DESTROY

The Scene Systems Destroy Event.

This event is dispatched by a Scene during the Scene Systems destroy process.

Listen to it from a Scene using this.scene.events.on('destroy', listener).

You should destroy any resources that may be in use by your Scene in this event handler.

Parameters:
Name Type Description
sys Phaser.Scenes.Systems

A reference to the Scene Systems class of the Scene that emitted this event.

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

PAUSE

The Scene Systems Pause Event.

This event is dispatched by a Scene when it is paused, either directly via the pause method, or as an action from another Scene.

Listen to it from a Scene using this.scene.events.on('pause', listener).

Parameters:
Name Type Argument Description
sys Phaser.Scenes.Systems

A reference to the Scene Systems class of the Scene that emitted this event.

data any <optional>

An optional data object that was passed to this Scene when it was paused.

Since: 3.0.0
Source: src/scene/events/PAUSE_EVENT.js (Line 7)

POST_UPDATE

The Scene Systems Post Update Event.

This event is dispatched by a Scene during the main game loop step.

The event flow for a single step of a Scene is as follows:

  1. PRE_UPDATE
  2. UPDATE
  3. The Scene.update method is called, if it exists
  4. POST_UPDATE
  5. RENDER

Listen to it from a Scene using this.scene.events.on('postupdate', listener).

A Scene will only run its step if it is active.

Parameters:
Name Type Description
sys Phaser.Scenes.Systems

A reference to the Scene Systems class of the Scene that emitted this event.

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/scene/events/POST_UPDATE_EVENT.js (Line 7)

PRE_UPDATE

The Scene Systems Pre Update Event.

This event is dispatched by a Scene during the main game loop step.

The event flow for a single step of a Scene is as follows:

  1. PRE_UPDATE
  2. UPDATE
  3. The Scene.update method is called, if it exists
  4. POST_UPDATE
  5. RENDER

Listen to it from a Scene using this.scene.events.on('preupdate', listener).

A Scene will only run its step if it is active.

Parameters:
Name Type Description
sys Phaser.Scenes.Systems

A reference to the Scene Systems class of the Scene that emitted this event.

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/scene/events/PRE_UPDATE_EVENT.js (Line 7)

READY

The Scene Systems Ready Event.

This event is dispatched by a Scene during the Scene Systems start process. By this point in the process the Scene is now fully active and rendering. This event is meant for your game code to use, as all plugins have responded to the earlier 'start' event.

Listen to it from a Scene using this.scene.events.on('ready', listener).

Parameters:
Name Type Argument Description
sys Phaser.Scenes.Systems

A reference to the Scene Systems class of the Scene that emitted this event.

data any <optional>

An optional data object that was passed to this Scene when it was started.

Since: 3.0.0
Source: src/scene/events/READY_EVENT.js (Line 7)

RENDER

The Scene Systems Render Event.

This event is dispatched by a Scene during the main game loop step.

The event flow for a single step of a Scene is as follows:

  1. PRE_UPDATE
  2. UPDATE
  3. The Scene.update method is called, if it exists
  4. POST_UPDATE
  5. RENDER

Listen to it from a Scene using this.scene.events.on('render', listener).

A Scene will only render if it is visible and active. By the time this event is dispatched, the Scene will have already been rendered.

Parameters:
Name Type Description
renderer Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer

The renderer that rendered the Scene.

Since: 3.0.0
Source: src/scene/events/RENDER_EVENT.js (Line 7)

RESUME

The Scene Systems Resume Event.

This event is dispatched by a Scene when it is resumed from a paused state, either directly via the resume method, or as an action from another Scene.

Listen to it from a Scene using this.scene.events.on('resume', listener).

Parameters:
Name Type Argument Description
sys Phaser.Scenes.Systems

A reference to the Scene Systems class of the Scene that emitted this event.

data any <optional>

An optional data object that was passed to this Scene when it was resumed.

Since: 3.0.0
Source: src/scene/events/RESUME_EVENT.js (Line 7)

SHUTDOWN

The Scene Systems Shutdown Event.

This event is dispatched by a Scene during the Scene Systems shutdown process.

Listen to it from a Scene using this.scene.events.on('shutdown', listener).

You should free-up any resources that may be in use by your Scene in this event handler, on the understanding that the Scene may, at any time, become active again. A shutdown Scene is not 'destroyed', it's simply not currently active. Use the DESTROY event to completely clear resources.

Parameters:
Name Type Argument Description
sys Phaser.Scenes.Systems

A reference to the Scene Systems class of the Scene that emitted this event.

data any <optional>

An optional data object that was passed to this Scene when it was shutdown.

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

SLEEP

The Scene Systems Sleep Event.

This event is dispatched by a Scene when it is sent to sleep, either directly via the sleep method, or as an action from another Scene.

Listen to it from a Scene using this.scene.events.on('sleep', listener).

Parameters:
Name Type Argument Description
sys Phaser.Scenes.Systems

A reference to the Scene Systems class of the Scene that emitted this event.

data any <optional>

An optional data object that was passed to this Scene when it was sent to sleep.

Since: 3.0.0
Source: src/scene/events/SLEEP_EVENT.js (Line 7)

START

The Scene Systems Start Event.

This event is dispatched by a Scene during the Scene Systems start process. Primarily used by Scene Plugins.

Listen to it from a Scene using this.scene.events.on('start', listener).

Parameters:
Name Type Description
sys Phaser.Scenes.Systems

A reference to the Scene Systems class of the Scene that emitted this event.

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

TRANSITION_COMPLETE

The Scene Transition Complete Event.

This event is dispatched by the Target Scene of a transition.

It happens when the transition process has completed. This occurs when the duration timer equals or exceeds the duration of the transition.

Listen to it from a Scene using this.scene.events.on('transitioncomplete', listener).

The Scene Transition event flow is as follows:

  1. TRANSITION_OUT - the Scene that started the transition will emit this event.
  2. TRANSITION_INIT - the Target Scene will emit this event if it has an init method.
  3. TRANSITION_START - the Target Scene will emit this event after its create method is called, OR ...
  4. TRANSITION_WAKE - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to.
  5. TRANSITION_COMPLETE - the Target Scene will emit this event when the transition finishes.
Parameters:
Name Type Description
scene Phaser.Scene

The Scene on which the transitioned completed.

Since: 3.5.0
Source: src/scene/events/TRANSITION_COMPLETE_EVENT.js (Line 7)

TRANSITION_INIT

The Scene Transition Init Event.

This event is dispatched by the Target Scene of a transition.

It happens immediately after the Scene.init method is called. If the Scene does not have an init method, this event is not dispatched.

Listen to it from a Scene using this.scene.events.on('transitioninit', listener).

The Scene Transition event flow is as follows:

  1. TRANSITION_OUT - the Scene that started the transition will emit this event.
  2. TRANSITION_INIT - the Target Scene will emit this event if it has an init method.
  3. TRANSITION_START - the Target Scene will emit this event after its create method is called, OR ...
  4. TRANSITION_WAKE - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to.
  5. TRANSITION_COMPLETE - the Target Scene will emit this event when the transition finishes.
Parameters:
Name Type Description
from Phaser.Scene

A reference to the Scene that is being transitioned from.

duration number

The duration of the transition in ms.

Since: 3.5.0
Source: src/scene/events/TRANSITION_INIT_EVENT.js (Line 7)

TRANSITION_OUT

The Scene Transition Out Event.

This event is dispatched by a Scene when it initiates a transition to another Scene.

Listen to it from a Scene using this.scene.events.on('transitionout', listener).

The Scene Transition event flow is as follows:

  1. TRANSITION_OUT - the Scene that started the transition will emit this event.
  2. TRANSITION_INIT - the Target Scene will emit this event if it has an init method.
  3. TRANSITION_START - the Target Scene will emit this event after its create method is called, OR ...
  4. TRANSITION_WAKE - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to.
  5. TRANSITION_COMPLETE - the Target Scene will emit this event when the transition finishes.
Parameters:
Name Type Description
target Phaser.Scene

A reference to the Scene that is being transitioned to.

duration number

The duration of the transition in ms.

Since: 3.5.0
Source: src/scene/events/TRANSITION_OUT_EVENT.js (Line 7)

TRANSITION_START

The Scene Transition Start Event.

This event is dispatched by the Target Scene of a transition, only if that Scene was not asleep.

It happens immediately after the Scene.create method is called. If the Scene does not have a create method, this event is dispatched anyway.

If the Target Scene was sleeping then the TRANSITION_WAKE event is dispatched instead of this event.

Listen to it from a Scene using this.scene.events.on('transitionstart', listener).

The Scene Transition event flow is as follows:

  1. TRANSITION_OUT - the Scene that started the transition will emit this event.
  2. TRANSITION_INIT - the Target Scene will emit this event if it has an init method.
  3. TRANSITION_START - the Target Scene will emit this event after its create method is called, OR ...
  4. TRANSITION_WAKE - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to.
  5. TRANSITION_COMPLETE - the Target Scene will emit this event when the transition finishes.
Parameters:
Name Type Description
from Phaser.Scene

A reference to the Scene that is being transitioned from.

duration number

The duration of the transition in ms.

Since: 3.5.0
Source: src/scene/events/TRANSITION_START_EVENT.js (Line 7)

TRANSITION_WAKE

The Scene Transition Wake Event.

This event is dispatched by the Target Scene of a transition, only if that Scene was asleep before the transition began. If the Scene was not asleep the TRANSITION_START event is dispatched instead.

Listen to it from a Scene using this.scene.events.on('transitionwake', listener).

The Scene Transition event flow is as follows:

  1. TRANSITION_OUT - the Scene that started the transition will emit this event.
  2. TRANSITION_INIT - the Target Scene will emit this event if it has an init method.
  3. TRANSITION_START - the Target Scene will emit this event after its create method is called, OR ...
  4. TRANSITION_WAKE - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to.
  5. TRANSITION_COMPLETE - the Target Scene will emit this event when the transition finishes.
Parameters:
Name Type Description
from Phaser.Scene

A reference to the Scene that is being transitioned from.

duration number

The duration of the transition in ms.

Since: 3.5.0
Source: src/scene/events/TRANSITION_WAKE_EVENT.js (Line 7)

UPDATE

The Scene Systems Update Event.

This event is dispatched by a Scene during the main game loop step.

The event flow for a single step of a Scene is as follows:

  1. PRE_UPDATE
  2. UPDATE
  3. The Scene.update method is called, if it exists
  4. POST_UPDATE
  5. RENDER

Listen to it from a Scene using this.scene.events.on('update', listener).

A Scene will only run its step if it is active.

Parameters:
Name Type Description
sys Phaser.Scenes.Systems

A reference to the Scene Systems class of the Scene that emitted this event.

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/scene/events/UPDATE_EVENT.js (Line 7)

WAKE

The Scene Systems Wake Event.

This event is dispatched by a Scene when it is woken from sleep, either directly via the wake method, or as an action from another Scene.

Listen to it from a Scene using this.scene.events.on('wake', listener).

Parameters:
Name Type Argument Description
sys Phaser.Scenes.Systems

A reference to the Scene Systems class of the Scene that emitted this event.

data any <optional>

An optional data object that was passed to this Scene when it was woken up.

Since: 3.0.0
Source: src/scene/events/WAKE_EVENT.js (Line 7)

COMPLETE

The Sound Complete Event.

This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they complete playback.

Listen to it from a Sound instance using Sound.on('complete', listener), i.e.:

var music = this.sound.add('key');
music.on('complete', listener);
music.play();
Parameters:
Name Type Description
sound Phaser.Sound.WebAudioSound | Phaser.Sound.HTML5AudioSound

A reference to the Sound that emitted the event.

Since: 3.16.1
Source: src/sound/events/COMPLETE_EVENT.js (Line 7)
Listeners of This Event:

DECODED

The Audio Data Decoded Event.

This event is dispatched by the Web Audio Sound Manager as a result of calling the decodeAudio method.

Listen to it from the Sound Manager in a Scene using this.sound.on('decoded', listener), i.e.:

this.sound.on('decoded', handler);
this.sound.decodeAudio(key, audioData);
Parameters:
Name Type Description
key string

The key of the audio file that was decoded and added to the audio cache.

Since: 3.18.0
Source: src/sound/events/DECODED_EVENT.js (Line 7)

DECODED_ALL

The Audio Data Decoded All Event.

This event is dispatched by the Web Audio Sound Manager as a result of calling the decodeAudio method, once all files passed to the method have been decoded (or errored).

Use Phaser.Sound.Events#DECODED to listen for single sounds being decoded, and DECODED_ALL to listen for them all completing.

Listen to it from the Sound Manager in a Scene using this.sound.on('decodedall', listener), i.e.:

this.sound.once('decodedall', handler);
this.sound.decodeAudio([ audioFiles ]);
Since: 3.18.0
Source: src/sound/events/DECODED_ALL_EVENT.js (Line 7)

DESTROY

The Sound Destroy Event.

This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are destroyed, either directly or via a Sound Manager.

Listen to it from a Sound instance using Sound.on('destroy', listener), i.e.:

var music = this.sound.add('key');
music.on('destroy', listener);
music.destroy();
Parameters:
Name Type Description
sound Phaser.Sound.WebAudioSound | Phaser.Sound.HTML5AudioSound

A reference to the Sound that emitted the event.

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

DETUNE

The Sound Detune Event.

This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their detune value changes.

Listen to it from a Sound instance using Sound.on('detune', listener), i.e.:

var music = this.sound.add('key');
music.on('detune', listener);
music.play();
music.setDetune(200);
Parameters:
Name Type Description
sound Phaser.Sound.WebAudioSound | Phaser.Sound.HTML5AudioSound

A reference to the Sound that emitted the event.

detune number

The new detune value of the Sound.

Since: 3.0.0
Source: src/sound/events/DETUNE_EVENT.js (Line 7)

GLOBAL_DETUNE

The Sound Manager Global Detune Event.

This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, or the HTML5 Audio Manager. It is dispatched when the detune property of the Sound Manager is changed, which globally adjusts the detuning of all active sounds.

Listen to it from a Scene using: this.sound.on('rate', listener).

Parameters:
Name Type Description
soundManager Phaser.Sound.BaseSoundManager

A reference to the sound manager that emitted the event.

detune number

The updated detune value.

Since: 3.0.0
Source: src/sound/events/GLOBAL_DETUNE_EVENT.js (Line 7)

GLOBAL_MUTE

The Sound Manager Global Mute Event.

This event is dispatched by the Sound Manager when its mute property is changed, either directly or via the setMute method. This changes the mute state of all active sounds.

Listen to it from a Scene using: this.sound.on('mute', listener).

Parameters:
Name Type Description
soundManager Phaser.Sound.WebAudioSoundManager | Phaser.Sound.HTML5AudioSoundManager

A reference to the sound manager that emitted the event.

mute boolean

The mute value. true if the Sound Manager is now muted, otherwise false.

Since: 3.0.0
Source: src/sound/events/GLOBAL_MUTE_EVENT.js (Line 7)

GLOBAL_RATE

The Sound Manager Global Rate Event.

This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, or the HTML5 Audio Manager. It is dispatched when the rate property of the Sound Manager is changed, which globally adjusts the playback rate of all active sounds.

Listen to it from a Scene using: this.sound.on('rate', listener).

Parameters:
Name Type Description
soundManager Phaser.Sound.BaseSoundManager

A reference to the sound manager that emitted the event.

rate number

The updated rate value.

Since: 3.0.0
Source: src/sound/events/GLOBAL_RATE_EVENT.js (Line 7)

GLOBAL_VOLUME

The Sound Manager Global Volume Event.

This event is dispatched by the Sound Manager when its volume property is changed, either directly or via the setVolume method. This changes the volume of all active sounds.

Listen to it from a Scene using: this.sound.on('volume', listener).

Parameters:
Name Type Description
soundManager Phaser.Sound.WebAudioSoundManager | Phaser.Sound.HTML5AudioSoundManager

A reference to the sound manager that emitted the event.

volume number

The new global volume of the Sound Manager.

Since: 3.0.0
Source: src/sound/events/GLOBAL_VOLUME_EVENT.js (Line 7)

LOOP

The Sound Loop Event.

This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their loop state is changed.

Listen to it from a Sound instance using Sound.on('loop', listener), i.e.:

var music = this.sound.add('key');
music.on('loop', listener);
music.setLoop(true);

This is not to be confused with the LOOPED event, which emits each time a Sound loops during playback.

Parameters:
Name Type Description
sound Phaser.Sound.WebAudioSound | Phaser.Sound.HTML5AudioSound

A reference to the Sound that emitted the event.

loop boolean

The new loop value. true if the Sound will loop, otherwise false.

Since: 3.0.0
Source: src/sound/events/LOOP_EVENT.js (Line 7)

LOOPED

The Sound Looped Event.

This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they loop during playback.

Listen to it from a Sound instance using Sound.on('looped', listener), i.e.:

var music = this.sound.add('key');
music.on('looped', listener);
music.setLoop(true);
music.play();

This is not to be confused with the LOOP event, which only emits when the loop state of a Sound is changed.

Parameters:
Name Type Description
sound Phaser.Sound.WebAudioSound | Phaser.Sound.HTML5AudioSound

A reference to the Sound that emitted the event.

Since: 3.0.0
Source: src/sound/events/LOOPED_EVENT.js (Line 7)

MUTE

The Sound Mute Event.

This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their mute state changes.

Listen to it from a Sound instance using Sound.on('mute', listener), i.e.:

var music = this.sound.add('key');
music.on('mute', listener);
music.play();
music.setMute(true);
Parameters:
Name Type Description
sound Phaser.Sound.WebAudioSound | Phaser.Sound.HTML5AudioSound

A reference to the Sound that emitted the event.

mute boolean

The mute value. true if the Sound is now muted, otherwise false.

Since: 3.0.0
Source: src/sound/events/MUTE_EVENT.js (Line 7)

PAUSE

The Sound Pause Event.

This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are paused.

Listen to it from a Sound instance using Sound.on('pause', listener), i.e.:

var music = this.sound.add('key');
music.on('pause', listener);
music.play();
music.pause();
Parameters:
Name Type Description
sound Phaser.Sound.WebAudioSound | Phaser.Sound.HTML5AudioSound

A reference to the Sound that emitted the event.

Since: 3.0.0
Source: src/sound/events/PAUSE_EVENT.js (Line 7)

PAUSE_ALL

The Pause All Sounds Event.

This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, or the HTML5 Audio Manager. It is dispatched when the pauseAll method is invoked and after all current Sounds have been paused.

Listen to it from a Scene using: this.sound.on('pauseall', listener).

Parameters:
Name Type Description
soundManager Phaser.Sound.BaseSoundManager

A reference to the sound manager that emitted the event.

Since: 3.0.0
Source: src/sound/events/PAUSE_ALL_EVENT.js (Line 7)

PLAY

The Sound Play Event.

This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are played.

Listen to it from a Sound instance using Sound.on('play', listener), i.e.:

var music = this.sound.add('key');
music.on('play', listener);
music.play();
Parameters:
Name Type Description
sound Phaser.Sound.WebAudioSound | Phaser.Sound.HTML5AudioSound

A reference to the Sound that emitted the event.

Since: 3.0.0
Source: src/sound/events/PLAY_EVENT.js (Line 7)

RATE

The Sound Rate Change Event.

This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their rate changes.

Listen to it from a Sound instance using Sound.on('rate', listener), i.e.:

var music = this.sound.add('key');
music.on('rate', listener);
music.play();
music.setRate(0.5);
Parameters:
Name Type Description
sound Phaser.Sound.WebAudioSound | Phaser.Sound.HTML5AudioSound

A reference to the Sound that emitted the event.

rate number

The new rate of the Sound.

Since: 3.0.0
Source: src/sound/events/RATE_EVENT.js (Line 7)

RESUME

The Sound Resume Event.

This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are resumed from a paused state.

Listen to it from a Sound instance using Sound.on('resume', listener), i.e.:

var music = this.sound.add('key');
music.on('resume', listener);
music.play();
music.pause();
music.resume();
Parameters:
Name Type Description
sound Phaser.Sound.WebAudioSound | Phaser.Sound.HTML5AudioSound

A reference to the Sound that emitted the event.

Since: 3.0.0
Source: src/sound/events/RESUME_EVENT.js (Line 7)

RESUME_ALL

The Resume All Sounds Event.

This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, or the HTML5 Audio Manager. It is dispatched when the resumeAll method is invoked and after all current Sounds have been resumed.

Listen to it from a Scene using: this.sound.on('resumeall', listener).

Parameters:
Name Type Description
soundManager Phaser.Sound.BaseSoundManager

A reference to the sound manager that emitted the event.

Since: 3.0.0
Source: src/sound/events/RESUME_ALL_EVENT.js (Line 7)

SEEK

The Sound Seek Event.

This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are seeked to a new position.

Listen to it from a Sound instance using Sound.on('seek', listener), i.e.:

var music = this.sound.add('key');
music.on('seek', listener);
music.play();
music.setSeek(5000);
Parameters:
Name Type Description
sound Phaser.Sound.WebAudioSound | Phaser.Sound.HTML5AudioSound

A reference to the Sound that emitted the event.

detune number

The new detune value of the Sound.

Since: 3.0.0
Source: src/sound/events/SEEK_EVENT.js (Line 7)

STOP

The Sound Stop Event.

This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are stopped.

Listen to it from a Sound instance using Sound.on('stop', listener), i.e.:

var music = this.sound.add('key');
music.on('stop', listener);
music.play();
music.stop();
Parameters:
Name Type Description
sound Phaser.Sound.WebAudioSound | Phaser.Sound.HTML5AudioSound

A reference to the Sound that emitted the event.

Since: 3.0.0
Source: src/sound/events/STOP_EVENT.js (Line 7)

STOP_ALL

The Stop All Sounds Event.

This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, or the HTML5 Audio Manager. It is dispatched when the stopAll method is invoked and after all current Sounds have been stopped.

Listen to it from a Scene using: this.sound.on('stopall', listener).

Parameters:
Name Type Description
soundManager Phaser.Sound.BaseSoundManager

A reference to the sound manager that emitted the event.

Since: 3.0.0
Source: src/sound/events/STOP_ALL_EVENT.js (Line 7)

UNLOCKED

The Sound Manager Unlocked Event.

This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, or the HTML5 Audio Manager. It is dispatched during the update loop when the Sound Manager becomes unlocked. For Web Audio this is on the first user gesture on the page.

Listen to it from a Scene using: this.sound.on('unlocked', listener).

Parameters:
Name Type Description
soundManager Phaser.Sound.BaseSoundManager

A reference to the sound manager that emitted the event.

Since: 3.0.0
Source: src/sound/events/UNLOCKED_EVENT.js (Line 7)

VOLUME

The Sound Volume Event.

This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their volume changes.

Listen to it from a Sound instance using Sound.on('volume', listener), i.e.:

var music = this.sound.add('key');
music.on('volume', listener);
music.play();
music.setVolume(0.5);
Parameters:
Name Type Description
sound Phaser.Sound.WebAudioSound | Phaser.Sound.HTML5AudioSound

A reference to the Sound that emitted the event.

volume number

The new volume of the Sound.

Since: 3.0.0
Source: src/sound/events/VOLUME_EVENT.js (Line 7)

ADD

The Texture Add Event.

This event is dispatched by the Texture Manager when a texture is added to it.

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

Parameters:
Name Type Description
key string

The key of the Texture that was added to the Texture Manager.

texture Phaser.Textures.Texture

A reference to the Texture that was added to the Texture Manager.

Since: 3.0.0
Source: src/textures/events/ADD_EVENT.js (Line 7)

ERROR

The Texture Load Error Event.

This event is dispatched by the Texture Manager when a texture it requested to load failed. This only happens when base64 encoded textures fail. All other texture types are loaded via the Loader Plugin.

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

Parameters:
Name Type Description
key string

The key of the Texture that failed to load into the Texture Manager.

Since: 3.0.0
Source: src/textures/events/ERROR_EVENT.js (Line 7)

LOAD

The Texture Load Event.

This event is dispatched by the Texture Manager when a texture has finished loading on it. This only happens for base64 encoded textures. All other texture types are loaded via the Loader Plugin.

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

This event is dispatched after the ADD event.

Parameters:
Name Type Description
key string

The key of the Texture that was loaded by the Texture Manager.

texture Phaser.Textures.Texture

A reference to the Texture that was loaded by the Texture Manager.

Since: 3.0.0
Source: src/textures/events/LOAD_EVENT.js (Line 7)

READY

This internal event signifies that the Texture Manager is now ready and the Game can continue booting.

When a Phaser Game instance is booting for the first time, the Texture Manager has to wait on a couple of non-blocking async events before it's fully ready to carry on. When those complete the Texture Manager emits this event via the Game instance, which tells the Game to carry on booting.

Since: 3.16.1
Source: src/textures/events/READY_EVENT.js (Line 7)
Listeners of This Event:

REMOVE

The Texture Remove Event.

This event is dispatched by the Texture Manager when a texture is removed from it.

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

If you have any Game Objects still using the removed texture, they will start throwing errors the next time they try to render. Be sure to clear all use of the texture in this event handler.

Parameters:
Name Type Description
key string

The key of the Texture that was removed from the Texture Manager.

Since: 3.0.0
Source: src/textures/events/REMOVE_EVENT.js (Line 7)

TIMELINE_COMPLETE

The Timeline Complete Event.

This event is dispatched by a Tween Timeline when it completes playback.

Listen to it from a Timeline instance using Timeline.on('complete', listener), i.e.:

var timeline = this.tweens.timeline({
    targets: image,
    ease: 'Power1',
    duration: 3000,
    tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ]
});
timeline.on('complete', listener);
timeline.play();
Parameters:
Name Type Description
timeline Phaser.Tweens.Timeline

A reference to the Timeline instance that emitted the event.

Since: 3.0.0
Source: src/tweens/events/TIMELINE_COMPLETE_EVENT.js (Line 7)

TIMELINE_LOOP

The Timeline Loop Event.

This event is dispatched by a Tween Timeline every time it loops.

Listen to it from a Timeline instance using Timeline.on('loop', listener), i.e.:

var timeline = this.tweens.timeline({
    targets: image,
    ease: 'Power1',
    duration: 3000,
    loop: 4,
    tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ]
});
timeline.on('loop', listener);
timeline.play();
Parameters:
Name Type Description
timeline Phaser.Tweens.Timeline

A reference to the Timeline instance that emitted the event.

loopCount integer

The number of loops left before this Timeline completes.

Since: 3.0.0
Source: src/tweens/events/TIMELINE_LOOP_EVENT.js (Line 7)

TIMELINE_PAUSE

The Timeline Pause Event.

This event is dispatched by a Tween Timeline when it is paused.

Listen to it from a Timeline instance using Timeline.on('pause', listener), i.e.:

var timeline = this.tweens.timeline({
    targets: image,
    ease: 'Power1',
    duration: 3000,
    tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ]
});
timeline.on('pause', listener);
// At some point later ...
timeline.pause();
Parameters:
Name Type Description
timeline Phaser.Tweens.Timeline

A reference to the Timeline instance that emitted the event.

Since: 3.0.0
Source: src/tweens/events/TIMELINE_PAUSE_EVENT.js (Line 7)

TIMELINE_RESUME

The Timeline Resume Event.

This event is dispatched by a Tween Timeline when it is resumed from a paused state.

Listen to it from a Timeline instance using Timeline.on('resume', listener), i.e.:

var timeline = this.tweens.timeline({
    targets: image,
    ease: 'Power1',
    duration: 3000,
    tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ]
});
timeline.on('resume', listener);
// At some point later ...
timeline.resume();
Parameters:
Name Type Description
timeline Phaser.Tweens.Timeline

A reference to the Timeline instance that emitted the event.

Since: 3.0.0
Source: src/tweens/events/TIMELINE_RESUME_EVENT.js (Line 7)

TIMELINE_START

The Timeline Start Event.

This event is dispatched by a Tween Timeline when it starts.

Listen to it from a Timeline instance using Timeline.on('start', listener), i.e.:

var timeline = this.tweens.timeline({
    targets: image,
    ease: 'Power1',
    duration: 3000,
    tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ]
});
timeline.on('start', listener);
timeline.play();
Parameters:
Name Type Description
timeline Phaser.Tweens.Timeline

A reference to the Timeline instance that emitted the event.

Since: 3.0.0
Source: src/tweens/events/TIMELINE_START_EVENT.js (Line 7)

TIMELINE_UPDATE

The Timeline Update Event.

This event is dispatched by a Tween Timeline every time it updates, which can happen a lot of times per second, so be careful about listening to this event unless you absolutely require it.

Listen to it from a Timeline instance using Timeline.on('update', listener), i.e.:

var timeline = this.tweens.timeline({
    targets: image,
    ease: 'Power1',
    duration: 3000,
    tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ]
});
timeline.on('update', listener);
timeline.play();
Parameters:
Name Type Description
timeline Phaser.Tweens.Timeline

A reference to the Timeline instance that emitted the event.

Since: 3.0.0
Source: src/tweens/events/TIMELINE_UPDATE_EVENT.js (Line 7)