Classes
- Camera3DPlugin
- Class
- Animation
- AnimationFrame
- AnimationManager
- AnimationState
- BaseCache
- CacheManager
- FixedKeyControl
- SmoothedKeyControl
- BaseCamera
- Camera
- CameraManager
- Fade
- Flash
- Pan
- RotateTo
- Shake
- Zoom
- Camera
- CameraManager
- OrthographicCamera
- PerspectiveCamera
- Config
- TimeStep
- CubicBezier
- Curve
- Ellipse
- Line
- MoveTo
- Path
- QuadraticBezier
- Spline
- DataManager
- DataManagerPlugin
- BaseShader
- Color
- ColorMatrix
- BitmapMask
- GeometryMask
- RGB
- RequestAnimationFrame
- EventEmitter
- FacebookInstantGamesLeaderboard
- FacebookInstantGamesPlugin
- Game
- Arc
- BitmapText
- Blitter
- Bob
- TransformMatrix
- Container
- Curve
- DisplayList
- DOMElement
- DynamicBitmapText
- Ellipse
- Extern
- GameObject
- GameObjectCreator
- GameObjectFactory
- Graphics
- Grid
- Group
- Image
- IsoBox
- IsoTriangle
- Layer
- Light
- LightsManager
- LightsPlugin
- Line
- Mesh
- EmitterOp
- GravityWell
- Particle
- ParticleEmitter
- ParticleEmitterManager
- DeathZone
- EdgeZone
- RandomZone
- PathFollower
- PointLight
- Polygon
- Rectangle
- RenderTexture
- Rope
- Shader
- Shape
- Sprite
- Sprite3D
- Star
- Text
- TextStyle
- TileSprite
- Triangle
- UpdateList
- Video
- Zone
- Circle
- Ellipse
- Line
- Face
- Vertex
- Point
- Polygon
- Rectangle
- Triangle
- Axis
- Button
- Gamepad
- GamepadPlugin
- InputManager
- InputPlugin
- Key
- KeyboardManager
- KeyboardPlugin
- KeyCombo
- MouseManager
- Pointer
- TouchManager
- File
- AnimationJSONFile
- AsepriteFile
- AtlasJSONFile
- AtlasXMLFile
- AudioFile
- AudioSpriteFile
- BinaryFile
- BitmapFontFile
- CSSFile
- GLSLFile
- HTML5AudioFile
- HTMLFile
- HTMLTextureFile
- ImageFile
- JSONFile
- MultiAtlasFile
- MultiScriptFile
- OBJFile
- PackFile
- PluginFile
- SceneFile
- ScenePluginFile
- ScriptFile
- SpineFile
- SpriteSheetFile
- SVGFile
- TextFile
- TilemapCSVFile
- TilemapImpactFile
- TilemapJSONFile
- UnityAtlasFile
- VideoFile
- XMLFile
- LoaderPlugin
- MultiFile
- Euler
- Matrix3
- Matrix4
- Quaternion
- RandomDataGenerator
- Vector2
- Vector3
- Vector4
- ArcadePhysics
- Body
- Collider
- Factory
- Group
- Image
- Sprite
- StaticBody
- StaticGroup
- World
- BodyBounds
- Factory
- Image
- MatterPhysics
- PointerConstraint
- Sprite
- TileBody
- World
- BasePlugin
- PluginManager
- ScenePlugin
- CanvasRenderer
- PipelineManager
- BitmapMaskPipeline
- GraphicsPipeline
- LightPipeline
- MultiPipeline
- PointLightPipeline
- PostFXPipeline
- RopePipeline
- SinglePipeline
- UtilityPipeline
- RenderTarget
- WebGLPipeline
- WebGLRenderer
- WebGLShader
- ScaleManager
- Scene
- SceneManager
- ScenePlugin
- Systems
- BaseSound
- BaseSoundManager
- HTML5AudioSound
- HTML5AudioSoundManager
- NoAudioSound
- NoAudioSoundManager
- WebAudioSound
- WebAudioSoundManager
- List
- Map
- ProcessQueue
- RTree
- Set
- Size
- CanvasTexture
- Frame
- Texture
- TextureManager
- TextureSource
- ImageCollection
- LayerData
- MapData
- ObjectLayer
- Tile
- Tilemap
- TilemapLayer
- Tileset
- Clock
- TimerEvent
- Timeline
- Tween
- TweenManager
- SpineContainer
- SpineGameObject
- SpinePlugin
Namespaces
- 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
- AlphaSingle
- BlendMode
- ComputedSize
- Crop
- Depth
- Flip
- GetBounds
- Mask
- Origin
- PathFollower
- Pipeline
- ScrollFactor
- Size
- Texture
- TextureCrop
- Tint
- Transform
- Visible
- Events
- Particles
- Zones
- RetroFont
- Geom
- Intersects
- Mesh
- 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
- Quadratic
- Quartic
- Quintic
- Sine
- Stepped
- Fuzzy
- Interpolation
- Pow2
- Snap
- Physics
- Arcade
- Components
- Acceleration
- Angular
- Bounce
- Debug
- Drag
- Enable
- Friction
- Gravity
- Immovable
- Mass
- Pushable
- Size
- Velocity
- Events
- Tilemap
- Matter
- Components
- Bounce
- Collision
- Force
- Friction
- Gravity
- Mass
- Sensor
- SetBody
- Sleep
- Static
- Transform
- Velocity
- Events
- Matter
- PhysicsEditorParser
- PhysicsJSONParser
- Plugins
- DefaultPlugins
- PluginCache
- Renderer
- Canvas
- Events
- Snapshot
- WebGL
- Pipelines
- Events
- Utils
- Scale
- Center
- Events
- Orientation
- ScaleModes
- Zoom
- ScaleModes
- Scenes
- Events
- Settings
- Sound
- Events
- Structs
- Events
- Textures
- Events
- FilterMode
- Parsers
- Tilemaps
- Components
- Formats
- Orientation
- 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
- Geom
- Mesh
- Input
- Gamepad
- Keyboard
- Loader
- FileTypes
- Math
- Physics
- Arcade
- Matter
- Plugins
- Renderer
- Snapshot
- WebGL
- Scenes
- Sound
- Textures
- Tilemaps
- Time
- Tweens
- Utils
- Array
- Matrix
- Base64
- Objects
- String
- SpinePluginEvents
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 a Sprite when an animation playing on it completes playback. This happens when the animation gets to the end of its sequence, factoring in any delays or repeats it may have to process.
An animation that is set to loop, or repeat forever, will never fire this event, because it never actually completes. If you need to handle this, listen for the
ANIMATION_STOP
event instead, as this is emitted when the animation is stopped directly.Listen for it on the Sprite using
sprite.on('animationcomplete', listener)
The animation event flow is as follows:
ANIMATION_START
ANIMATION_UPDATE
(repeated for however many frames the animation has)ANIMATION_REPEAT
(only if the animation is set to repeat, it then emits more update events after this)ANIMATION_COMPLETE
(only if there is a finite, or zero, repeat count)ANIMATION_COMPLETE_KEY
(only if there is a finite, or zero, repeat count)
If the animation is stopped directly, the
ANIMATION_STOP
event is dispatched instead ofANIMATION_COMPLETE
.If the animation is restarted while it is already playing,
ANIMATION_RESTART
is emitted.Parameters:
Name Type Description animation
Phaser.Animations.Animation A reference to the Animation that completed.
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.
frameKey
string The unique key of the Animation Frame within the Animation.
- Since: 3.50.0
- Source: src/animations/events/ANIMATION_COMPLETE_EVENT.js (Line 7)
-
ANIMATION_COMPLETE_KEY
-
The Animation Complete Dynamic Key Event.
This event is dispatched by a Sprite when an animation playing on it completes playback. This happens when the animation gets to the end of its sequence, factoring in any delays or repeats it may have to process.
An animation that is set to loop, or repeat forever, will never fire this event, because it never actually completes. If you need to handle this, listen for the
ANIMATION_STOP
event instead, as this is emitted when the animation is stopped directly.The difference between this and the
ANIMATION_COMPLETE
event is that this one has a dynamic event name that contains the name of the animation within it. For example, if you had an animation calledexplode
you could listen for the completion of that specific animation by using:sprite.on('animationcomplete-explode', listener)
. Or, if you wish to use types:sprite.on(Phaser.Animations.Events.ANIMATION_COMPLETE_KEY + 'explode', listener)
.The animation event flow is as follows:
ANIMATION_START
ANIMATION_UPDATE
(repeated for however many frames the animation has)ANIMATION_REPEAT
(only if the animation is set to repeat, it then emits more update events after this)ANIMATION_COMPLETE
(only if there is a finite, or zero, repeat count)ANIMATION_COMPLETE_KEY
(only if there is a finite, or zero, repeat count)
If the animation is stopped directly, the
ANIMATION_STOP
event is dispatched instead ofANIMATION_COMPLETE
.If the animation is restarted while it is already playing,
ANIMATION_RESTART
is emitted.Parameters:
Name Type Description animation
Phaser.Animations.Animation A reference to the Animation that completed.
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.
frameKey
string The unique key of the Animation Frame within the Animation.
- Since: 3.50.0
- Source: src/animations/events/ANIMATION_COMPLETE_KEY_EVENT.js (Line 7)
-
ANIMATION_REPEAT
-
The Animation Repeat Event.
This event is dispatched by a Sprite when an animation repeats playing on it. This happens if the animation was created, or played, with a
repeat
value specified.An animation will repeat when it reaches the end of its sequence.
Listen for it on the Sprite using
sprite.on('animationrepeat', listener)
The animation event flow is as follows:
ANIMATION_START
ANIMATION_UPDATE
(repeated for however many frames the animation has)ANIMATION_REPEAT
(only if the animation is set to repeat, it then emits more update events after this)ANIMATION_COMPLETE
(only if there is a finite, or zero, repeat count)ANIMATION_COMPLETE_KEY
(only if there is a finite, or zero, repeat count)
If the animation is stopped directly, the
ANIMATION_STOP
event is dispatched instead ofANIMATION_COMPLETE
.If the animation is restarted while it is already playing,
ANIMATION_RESTART
is emitted.Parameters:
Name Type Description animation
Phaser.Animations.Animation A reference to the Animation that has repeated.
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 repeated.
frameKey
string The unique key of the Animation Frame within the Animation.
- Since: 3.50.0
- Source: src/animations/events/ANIMATION_REPEAT_EVENT.js (Line 7)
-
ANIMATION_RESTART
-
The Animation Restart Event.
This event is dispatched by a Sprite when an animation restarts playing on it. This only happens when the
Sprite.anims.restart
method is called.Listen for it on the Sprite using
sprite.on('animationrestart', listener)
The animation event flow is as follows:
ANIMATION_START
ANIMATION_UPDATE
(repeated for however many frames the animation has)ANIMATION_REPEAT
(only if the animation is set to repeat, it then emits more update events after this)ANIMATION_COMPLETE
(only if there is a finite, or zero, repeat count)ANIMATION_COMPLETE_KEY
(only if there is a finite, or zero, repeat count)
If the animation is stopped directly, the
ANIMATION_STOP
event is dispatched instead ofANIMATION_COMPLETE
.If the animation is restarted while it is already playing,
ANIMATION_RESTART
is emitted.Parameters:
Name Type Description animation
Phaser.Animations.Animation A reference to the Animation that has restarted.
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 restarted.
frameKey
string The unique key of the Animation Frame within the Animation.
- Since: 3.50.0
- Source: src/animations/events/ANIMATION_RESTART_EVENT.js (Line 7)
-
ANIMATION_START
-
The Animation Start Event.
This event is dispatched by a Sprite when an animation starts playing on it. This happens when the animation is played, factoring in any delay that may have been specified. This event happens after the delay has expired and prior to the first update event.
Listen for it on the Sprite using
sprite.on('animationstart', listener)
The animation event flow is as follows:
ANIMATION_START
ANIMATION_UPDATE
(repeated for however many frames the animation has)ANIMATION_REPEAT
(only if the animation is set to repeat, it then emits more update events after this)ANIMATION_COMPLETE
(only if there is a finite, or zero, repeat count)ANIMATION_COMPLETE_KEY
(only if there is a finite, or zero, repeat count)
If the animation is stopped directly, the
ANIMATION_STOP
event is dispatched instead ofANIMATION_COMPLETE
.If the animation is restarted while it is already playing,
ANIMATION_RESTART
is emitted.Parameters:
Name Type Description animation
Phaser.Animations.Animation A reference to the Animation that has started.
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 started.
frameKey
string The unique key of the Animation Frame within the Animation.
- Since: 3.50.0
- Source: src/animations/events/ANIMATION_START_EVENT.js (Line 7)
-
ANIMATION_STOP
-
The Animation Stop Event.
This event is dispatched by a Sprite when an animation is stopped on it. An animation will only be stopeed if a method such as
Sprite.stop
orSprite.anims.stopAfterDelay
is called. It can also be emitted if a new animation is started before the current one completes.Listen for it on the Sprite using
sprite.on('animationstop', listener)
The animation event flow is as follows:
ANIMATION_START
ANIMATION_UPDATE
(repeated for however many frames the animation has)ANIMATION_REPEAT
(only if the animation is set to repeat, it then emits more update events after this)ANIMATION_COMPLETE
(only if there is a finite, or zero, repeat count)ANIMATION_COMPLETE_KEY
(only if there is a finite, or zero, repeat count)
If the animation is stopped directly, the
ANIMATION_STOP
event is dispatched instead ofANIMATION_COMPLETE
.If the animation is restarted while it is already playing,
ANIMATION_RESTART
is emitted.Parameters:
Name Type Description animation
Phaser.Animations.Animation A reference to the Animation that has stopped.
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 stopped.
frameKey
string The unique key of the Animation Frame within the Animation.
- Since: 3.50.0
- Source: src/animations/events/ANIMATION_STOP_EVENT.js (Line 7)
-
ANIMATION_UPDATE
-
The Animation Update Event.
This event is dispatched by a Sprite when an animation playing on it updates. This happens when the animation changes frame. An animation will change frame based on the frme rate and other factors like
timeScale
anddelay
. It can also change frame when stopped or restarted.Listen for it on the Sprite using
sprite.on('animationupdate', listener)
If an animation is playing faster than the game frame-rate can handle, it's entirely possible for it to emit several update events in a single game frame, so please be aware of this in your code. The final event received that frame is the one that is rendered to the game.
The animation event flow is as follows:
ANIMATION_START
ANIMATION_UPDATE
(repeated for however many frames the animation has)ANIMATION_REPEAT
(only if the animation is set to repeat, it then emits more update events after this)ANIMATION_COMPLETE
(only if there is a finite, or zero, repeat count)ANIMATION_COMPLETE_KEY
(only if there is a finite, or zero, repeat count)
If the animation is stopped directly, the
ANIMATION_STOP
event is dispatched instead ofANIMATION_COMPLETE
.If the animation is restarted while it is already playing,
ANIMATION_RESTART
is emitted.Parameters:
Name Type Description animation
Phaser.Animations.Animation A reference to the Animation that has updated.
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.
frameKey
string The unique key of the Animation Frame within the Animation.
- Since: 3.50.0
- Source: src/animations/events/ANIMATION_UPDATE_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)
-
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
number The duration of the effect.
red
number The red color channel value.
green
number The green color channel value.
blue
number 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
number The duration of the effect.
red
number The red color channel value.
green
number The green color channel value.
blue
number 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
number The duration of the effect.
red
number The red color channel value.
green
number The green color channel value.
blue
number The blue color channel value.
- Since: 3.3.0
- Source: src/cameras/2d/events/FLASH_START_EVENT.js (Line 7)
-
FOLLOW_UPDATE
-
The Camera Follower Update Event.
This event is dispatched by a Camera instance when it is following a Game Object and the Camera position has been updated as a result of that following.
Listen to it from a Camera instance using:
camera.on('followupdate', listener)
.Parameters:
Name Type Description camera
Phaser.Cameras.Scene2D.BaseCamera The camera that emitted the event.
gameObject
Phaser.GameObjects.GameObject The Game Object the camera is following.
- Since: 3.50.0
- Source: src/cameras/2d/events/FOLLOW_UPDATE_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
number 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)
-
ROTATE_COMPLETE
-
The Camera Rotate Complete Event.
This event is dispatched by a Camera instance when the Rotate Effect completes.
Parameters:
Name Type Description camera
Phaser.Cameras.Scene2D.Camera The camera that the effect began on.
effect
Phaser.Cameras.Scene2D.Effects.RotateTo A reference to the effect instance.
- Since: 3.23.0
- Source: src/cameras/2d/events/ROTATE_COMPLETE_EVENT.js (Line 7)
-
ROTATE_START
-
The Camera Rotate Start Event.
This event is dispatched by a Camera instance when the Rotate Effect starts.
Parameters:
Name Type Description camera
Phaser.Cameras.Scene2D.Camera The camera that the effect began on.
effect
Phaser.Cameras.Scene2D.Effects.RotateTo A reference to the effect instance.
duration
number The duration of the effect.
destination
number The destination value.
- Since: 3.23.0
- Source: src/cameras/2d/events/ROTATE_START_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
number 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
number 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:
-
CONTEXT_LOST
-
The Game Context Lost Event.
This event is dispatched by the Game if the WebGL Renderer it is using encounters a WebGL Context Lost event from the browser.
The partner event is
CONTEXT_RESTORED
.- Since: 3.19.0
- Source: src/core/events/CONTEXT_LOST_EVENT.js (Line 7)
-
CONTEXT_RESTORED
-
The Game Context Restored Event.
This event is dispatched by the Game if the WebGL Renderer it is using encounters a WebGL Context Restored event from the browser.
The partner event is
CONTEXT_LOST
.- Since: 3.19.0
- Source: src/core/events/CONTEXT_RESTORED_EVENT.js (Line 7)
-
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)
, wherekey
is the unique string key of the data item. For example, if you have a data item stored calledgold
then you can listen forsprite.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.
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)
-
DESTROY
-
The Data Manager Destroy Event.
The Data Manager will listen for the destroy event from its parent, and then close itself down.
- Since: 3.50.0
- Source: src/data/events/DESTROY_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)
-
ADDED_TO_SCENE
-
The Game Object Added to Scene Event.
This event is dispatched when a Game Object is added to a Scene.
Listen for it on a Game Object instance using
GameObject.on('addedtoscene', listener)
.Parameters:
Name Type Description gameObject
Phaser.GameObjects.GameObject The Game Object that was added to the Scene.
scene
Phaser.Scene The Scene to which the Game Object was added.
- Since: 3.50.0
- Source: src/gameobjects/events/ADDED_TO_SCENE_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)
-
REMOVED_FROM_SCENE
-
The Game Object Removed from Scene Event.
This event is dispatched when a Game Object is removed from a Scene.
Listen for it on a Game Object instance using
GameObject.on('removedfromscene', listener)
.Parameters:
Name Type Description gameObject
Phaser.GameObjects.GameObject The Game Object that was removed from the Scene.
scene
Phaser.Scene The Scene from which the Game Object was removed.
- Since: 3.50.0
- Source: src/gameobjects/events/REMOVED_FROM_SCENE_EVENT.js (Line 7)
-
VIDEO_COMPLETE
-
The Video Game Object Complete Event.
This event is dispatched when a Video finishes playback by reaching the end of its duration. It is also dispatched if a video marker sequence is being played and reaches the end.
Note that not all videos can fire this event. Live streams, for example, have no fixed duration, so never technically 'complete'.
If a video is stopped from playback, via the
Video.stop
method, it will emit theVIDEO_STOP
event instead of this one.Listen for it from a Video Game Object instance using
Video.on('complete', listener)
.Parameters:
Name Type Description video
Phaser.GameObjects.Video The Video Game Object which completed playback.
- Since: 3.20.0
- Source: src/gameobjects/events/VIDEO_COMPLETE_EVENT.js (Line 7)
-
VIDEO_CREATED
-
The Video Game Object Created Event.
This event is dispatched when the texture for a Video has been created. This happens when enough of the video source has been loaded that the browser is able to render a frame from it.
Listen for it from a Video Game Object instance using
Video.on('created', listener)
.Parameters:
Name Type Description video
Phaser.GameObjects.Video The Video Game Object which raised the event.
width
number The width of the video.
height
number The height of the video.
- Since: 3.20.0
- Source: src/gameobjects/events/VIDEO_CREATED_EVENT.js (Line 7)
-
VIDEO_ERROR
-
The Video Game Object Error Event.
This event is dispatched when a Video tries to play a source that does not exist, or is the wrong file type.
Listen for it from a Video Game Object instance using
Video.on('error', listener)
.Parameters:
Name Type Description video
Phaser.GameObjects.Video The Video Game Object which threw the error.
event
Event The native DOM event the browser raised during playback.
- Since: 3.20.0
- Source: src/gameobjects/events/VIDEO_ERROR_EVENT.js (Line 7)
-
VIDEO_LOOP
-
The Video Game Object Loop Event.
This event is dispatched when a Video that is currently playing has looped. This only happens if the
loop
parameter was specified, or thesetLoop
method was called, and if the video has a fixed duration. Video streams, for example, cannot loop, as they have no duration.Looping is based on the result of the Video
timeupdate
event. This event is not frame-accurate, due to the way browsers work, so please do not rely on this loop event to be time or frame precise.Listen for it from a Video Game Object instance using
Video.on('loop', listener)
.Parameters:
Name Type Description video
Phaser.GameObjects.Video The Video Game Object which has looped.
- Since: 3.20.0
- Source: src/gameobjects/events/VIDEO_LOOP_EVENT.js (Line 7)
-
VIDEO_PLAY
-
The Video Game Object Play Event.
This event is dispatched when a Video begins playback. For videos that do not require interaction unlocking, this is usually as soon as the
Video.play
method is called. However, for videos that require unlocking, it is fired once playback begins after they've been unlocked.Listen for it from a Video Game Object instance using
Video.on('play', listener)
.Parameters:
Name Type Description video
Phaser.GameObjects.Video The Video Game Object which started playback.
- Since: 3.20.0
- Source: src/gameobjects/events/VIDEO_PLAY_EVENT.js (Line 7)
-
VIDEO_SEEKED
-
The Video Game Object Seeked Event.
This event is dispatched when a Video completes seeking to a new point in its timeline.
Listen for it from a Video Game Object instance using
Video.on('seeked', listener)
.Parameters:
Name Type Description video
Phaser.GameObjects.Video The Video Game Object which completed seeking.
- Since: 3.20.0
- Source: src/gameobjects/events/VIDEO_SEEKED_EVENT.js (Line 7)
-
VIDEO_SEEKING
-
The Video Game Object Seeking Event.
This event is dispatched when a Video begins seeking to a new point in its timeline. When the seek is complete, it will dispatch the
VIDEO_SEEKED
event to conclude.Listen for it from a Video Game Object instance using
Video.on('seeking', listener)
.Parameters:
Name Type Description video
Phaser.GameObjects.Video The Video Game Object which started seeking.
- Since: 3.20.0
- Source: src/gameobjects/events/VIDEO_SEEKING_EVENT.js (Line 7)
-
VIDEO_STOP
-
The Video Game Object Stopped Event.
This event is dispatched when a Video is stopped from playback via a call to the
Video.stop
method, either directly via game code, or indirectly as the result of changing a video source or destroying it.Listen for it from a Video Game Object instance using
Video.on('stop', listener)
.Parameters:
Name Type Description video
Phaser.GameObjects.Video The Video Game Object which stopped playback.
- Since: 3.20.0
- Source: src/gameobjects/events/VIDEO_STOP_EVENT.js (Line 7)
-
VIDEO_TIMEOUT
-
The Video Game Object Timeout Event.
This event is dispatched when a Video has exhausted its allocated time while trying to connect to a video source to start playback.
Listen for it from a Video Game Object instance using
Video.on('timeout', listener)
.Parameters:
Name Type Description video
Phaser.GameObjects.Video The Video Game Object which timed out.
- Since: 3.20.0
- Source: src/gameobjects/events/VIDEO_TIMEOUT_EVENT.js (Line 7)
-
VIDEO_UNLOCKED
-
The Video Game Object Unlocked Event.
This event is dispatched when a Video that was prevented from playback due to the browsers Media Engagement Interaction policy, is unlocked by a user gesture.
Listen for it from a Video Game Object instance using
Video.on('unlocked', listener)
.Parameters:
Name Type Description video
Phaser.GameObjects.Video The Video Game Object which raised the event.
- Since: 3.20.0
- Source: src/gameobjects/events/VIDEO_UNLOCKED_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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop the propagation of this event.
Parameters:
Name Type Description pointer
Phaser.Input.Pointer The Pointer responsible for triggering this event.
currentlyOver
Array.<Phaser.GameObjects.GameObject> An array containing all interactive Game Objects that the pointer was over when the event was created.
- Since: 3.0.0
- Source: src/input/events/POINTER_MOVE_EVENT.js (Line 7)
-
POINTER_OUT
-
The Pointer Out Input Event.
This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves out of any interactive Game Object.
Listen to this event from within a Scene using:
this.input.on('pointerout', listener)
.The event hierarchy is as follows:
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:
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:
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:
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:
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
number 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
number 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 theA
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 theA
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
number The total number of files that successfully loaded.
totalFailed
number 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 ofmonster
, 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 ofLevel1
: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 ofGAMEOVER
: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)
.Parameters:
Name Type Description delta
number The delta time amount of this step, in seconds.
- Since: 3.18.0
- Source: src/physics/arcade/events/WORLD_STEP_EVENT.js (Line 7)
-
AFTER_ADD
-
The Matter Physics After Add Event.
This event is dispatched by a Matter Physics World instance at the end of the process when a new Body or Constraint has just been added to the world.
Listen to it from a Scene using:
this.matter.world.on('afteradd', listener)
.Parameters:
Name Type Description event
Phaser.Physics.Matter.Events.AfterAddEvent The Add Event object.
- Since: 3.22.0
- Source: src/physics/matter-js/events/AFTER_ADD_EVENT.js (Line 15)
-
AFTER_REMOVE
-
The Matter Physics After Remove Event.
This event is dispatched by a Matter Physics World instance at the end of the process when a Body or Constraint was removed from the world.
Listen to it from a Scene using:
this.matter.world.on('afterremove', listener)
.Parameters:
Name Type Description event
Phaser.Physics.Matter.Events.AfterRemoveEvent The Remove Event object.
- Since: 3.22.0
- Source: src/physics/matter-js/events/AFTER_REMOVE_EVENT.js (Line 15)
-
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_ADD
-
The Matter Physics Before Add Event.
This event is dispatched by a Matter Physics World instance at the start of the process when a new Body or Constraint is being added to the world.
Listen to it from a Scene using:
this.matter.world.on('beforeadd', listener)
.Parameters:
Name Type Description event
Phaser.Physics.Matter.Events.BeforeAddEvent The Add Event object.
- Since: 3.22.0
- Source: src/physics/matter-js/events/BEFORE_ADD_EVENT.js (Line 15)
-
BEFORE_REMOVE
-
The Matter Physics Before Remove Event.
This event is dispatched by a Matter Physics World instance at the start of the process when a Body or Constraint is being removed from the world.
Listen to it from a Scene using:
this.matter.world.on('beforeremove', listener)
.Parameters:
Name Type Description event
Phaser.Physics.Matter.Events.BeforeRemoveEvent The Remove Event object.
- Since: 3.22.0
- Source: src/physics/matter-js/events/BEFORE_REMOVE_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.BodyType The first body of the first colliding pair. The
event.pairs
array may contain more colliding bodies.bodyB
MatterJS.BodyType 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.BodyType The first body of the first colliding pair. The
event.pairs
array may contain more colliding bodies.bodyB
MatterJS.BodyType 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.BodyType The first body of the first colliding pair. The
event.pairs
array may contain more colliding bodies.bodyB
MatterJS.BodyType 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.BodyType 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.BodyType 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.BodyType The Body that has started being dragged. This is a Matter Body, not a Phaser Game Object.
part
MatterJS.BodyType 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.BodyType 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.BodyType The body that has gone to sleep.
- Since: 3.0.0
- Source: src/physics/matter-js/events/SLEEP_START_EVENT.js (Line 14)
-
POST_RENDER
-
The Post-Render Event.
This event is dispatched by the Renderer when all rendering, for all cameras in all Scenes, has completed, but before any pending snap shots have been taken.
- Since: 3.50.0
- Source: src/renderer/events/POST_RENDER_EVENT.js (Line 7)
-
PRE_RENDER
-
The Pre-Render Event.
This event is dispatched by the Phaser Renderer. This happens right at the start of the render process, after the context has been cleared, the scissors enabled (WebGL only) and everything has been reset ready for the render.
- Since: 3.50.0
- Source: src/renderer/events/PRE_RENDER_EVENT.js (Line 7)
-
RENDER
-
The Render Event.
This event is dispatched by the Phaser Renderer for every camera in every Scene.
It is dispatched before any of the children in the Scene have been rendered.
Parameters:
Name Type Description scene
Phaser.Scene The Scene being rendered.
camera
Phaser.Cameras.Scene2D.Camera The Scene Camera being rendered.
- Since: 3.50.0
- Source: src/renderer/events/RENDER_EVENT.js (Line 7)
-
RESIZE
-
The Renderer Resize Event.
This event is dispatched by the Phaser Renderer when it is resized, usually as a result of the Scale Manager resizing.
Parameters:
Name Type Description width
number The new width of the renderer.
height
number The new height of the renderer.
- Since: 3.50.0
- Source: src/renderer/events/RESIZE_EVENT.js (Line 7)
-
AFTER_FLUSH
-
The WebGLPipeline After Flush Event.
This event is dispatched by a WebGLPipeline right after it has issued a drawArrays command and cleared its vertex count.
Parameters:
Name Type Description pipeline
Phaser.Renderer.WebGL.WebGLPipeline The pipeline that has flushed.
isPostFlush
boolean Was this flush invoked as part of a post-process, or not?
- Since: 3.50.0
- Source: src/renderer/webgl/pipelines/events/AFTER_FLUSH_EVENT.js (Line 7)
-
BEFORE_FLUSH
-
The WebGLPipeline Before Flush Event.
This event is dispatched by a WebGLPipeline right before it is about to flush and issue a bufferData and drawArrays command.
Parameters:
Name Type Description pipeline
Phaser.Renderer.WebGL.WebGLPipeline The pipeline that is about to flush.
isPostFlush
boolean Was this flush invoked as part of a post-process, or not?
- Since: 3.50.0
- Source: src/renderer/webgl/pipelines/events/BEFORE_FLUSH_EVENT.js (Line 7)
-
BIND
-
The WebGLPipeline Bind Event.
This event is dispatched by a WebGLPipeline when it is bound by the Pipeline Manager.
Parameters:
Name Type Description pipeline
Phaser.Renderer.WebGL.WebGLPipeline The pipeline that was bound.
currentShader
Phaser.Renderer.WebGL.WebGLShader The shader that was set as being current.
- Since: 3.50.0
- Source: src/renderer/webgl/pipelines/events/BIND_EVENT.js (Line 7)
-
BOOT
-
The WebGLPipeline Boot Event.
This event is dispatched by a WebGLPipeline when it has completed its
boot
phase.Parameters:
Name Type Description pipeline
Phaser.Renderer.WebGL.WebGLPipeline The pipeline that booted.
- Since: 3.50.0
- Source: src/renderer/webgl/pipelines/events/BOOT_EVENT.js (Line 7)
-
DESTROY
-
The WebGLPipeline Destroy Event.
This event is dispatched by a WebGLPipeline when it is starting its destroy process.
Parameters:
Name Type Description pipeline
Phaser.Renderer.WebGL.WebGLPipeline The pipeline that has flushed.
- Since: 3.50.0
- Source: src/renderer/webgl/pipelines/events/DESTROY_EVENT.js (Line 7)
-
REBIND
-
The WebGLPipeline ReBind Event.
This event is dispatched by a WebGLPipeline when it is re-bound by the Pipeline Manager.
Parameters:
Name Type Description pipeline
Phaser.Renderer.WebGL.WebGLPipeline The pipeline that was rebound.
currentShader
Phaser.Renderer.WebGL.WebGLShader The shader that was set as being current.
- Since: 3.50.0
- Source: src/renderer/webgl/pipelines/events/REBIND_EVENT.js (Line 7)
-
RESIZE
-
The WebGLPipeline Resize Event.
This event is dispatched by a WebGLPipeline when it is resized, usually as a result of the Renderer resizing.
Parameters:
Name Type Description width
number The new width of the pipeline.
height
number The new height of the pipeline.
pipeline
Phaser.Renderer.WebGL.WebGLPipeline The pipeline that was resized.
- Since: 3.50.0
- Source: src/renderer/webgl/pipelines/events/RESIZE_EVENT.js (Line 7)
-
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.
This event is dispatched whenever the Scale Manager detects an orientation change event from the browser.
Parameters:
Name Type Description orientation
string The new orientation value. Either
Phaser.Scale.Orientation.LANDSCAPE
orPhaser.Scale.Orientation.PORTRAIT
.- 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.
displaySize
Phaser.Structs.Size A reference to the Display Size component. This is the scaled canvas size, after applying zoom and scale mode.
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)
-
ADDED_TO_SCENE
-
The Game Object Added to Scene Event.
This event is dispatched when a Game Object is added to a Scene.
Listen for it from a Scene using
this.scene.events.on('addedtoscene', listener)
.Parameters:
Name Type Description gameObject
Phaser.GameObjects.GameObject The Game Object that was added to the Scene.
scene
Phaser.Scene The Scene to which the Game Object was added.
- Since: 3.50.0
- Source: src/scene/events/ADDED_TO_SCENE_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:
PRE_UPDATE
UPDATE
- The
Scene.update
method is called, if it exists POST_UPDATE
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:
PRE_UPDATE
UPDATE
- The
Scene.update
method is called, if it exists POST_UPDATE
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)
-
REMOVED_FROM_SCENE
-
The Game Object Removed from Scene Event.
This event is dispatched when a Game Object is removed from a Scene.
Listen for it from a Scene using
this.scene.events.on('removedfromscene', listener)
.Parameters:
Name Type Description gameObject
Phaser.GameObjects.GameObject The Game Object that was removed from the Scene.
scene
Phaser.Scene The Scene from which the Game Object was removed.
- Since: 3.50.0
- Source: src/scene/events/REMOVED_FROM_SCENE_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:
PRE_UPDATE
UPDATE
- The
Scene.update
method is called, if it exists POST_UPDATE
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:
TRANSITION_OUT
- the Scene that started the transition will emit this event.TRANSITION_INIT
- the Target Scene will emit this event if it has aninit
method.TRANSITION_START
- the Target Scene will emit this event after itscreate
method is called, OR ...TRANSITION_WAKE
- the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to.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 aninit
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:
TRANSITION_OUT
- the Scene that started the transition will emit this event.TRANSITION_INIT
- the Target Scene will emit this event if it has aninit
method.TRANSITION_START
- the Target Scene will emit this event after itscreate
method is called, OR ...TRANSITION_WAKE
- the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to.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:
TRANSITION_OUT
- the Scene that started the transition will emit this event.TRANSITION_INIT
- the Target Scene will emit this event if it has aninit
method.TRANSITION_START
- the Target Scene will emit this event after itscreate
method is called, OR ...TRANSITION_WAKE
- the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to.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 acreate
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:
TRANSITION_OUT
- the Scene that started the transition will emit this event.TRANSITION_INIT
- the Target Scene will emit this event if it has aninit
method.TRANSITION_START
- the Target Scene will emit this event after itscreate
method is called, OR ...TRANSITION_WAKE
- the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to.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:
TRANSITION_OUT
- the Scene that started the transition will emit this event.TRANSITION_INIT
- the Target Scene will emit this event if it has aninit
method.TRANSITION_START
- the Target Scene will emit this event after itscreate
method is called, OR ...TRANSITION_WAKE
- the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to.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:
PRE_UPDATE
UPDATE
- The
Scene.update
method is called, if it exists POST_UPDATE
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:
- Phaser.Sound.BaseSoundManager#play
- Phaser.Sound.BaseSoundManager#playAudioSprite
- Phaser.Sound.HTML5AudioSoundManager#play
- Phaser.Sound.HTML5AudioSoundManager#playAudioSprite
- Phaser.Sound.NoAudioSoundManager#play
- Phaser.Sound.NoAudioSoundManager#playAudioSprite
- Phaser.Sound.WebAudioSoundManager#play
- Phaser.Sound.WebAudioSoundManager#playAudioSprite
-
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, andDECODED_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 thesetMute
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, otherwisefalse
.- 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 thesetVolume
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, otherwisefalse
.- 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, otherwisefalse
.- Since: 3.0.0
- Source: src/sound/events/MUTE_EVENT.js (Line 7)
-
PAN
-
The Sound Pan Event.
This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their pan changes.
Listen to it from a Sound instance using
Sound.on('pan', listener)
, i.e.:var sound = this.sound.add('key'); sound.on('pan', listener); sound.play(); sound.setPan(0.5);
Parameters:
Name Type Description sound
Phaser.Sound.WebAudioSound | Phaser.Sound.HTML5AudioSound A reference to the Sound that emitted the event.
pan
number The new pan of the Sound.
- Since: 3.50.0
- Source: src/sound/events/PAN_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)
-
PROCESS_QUEUE_ADD
-
The Process Queue Add Event.
This event is dispatched by a Process Queue when a new item is successfully moved to its active list.
You will most commonly see this used by a Scene's Update List when a new Game Object has been added.
In that instance, listen to this event from within a Scene using:
this.sys.updateList.on('add', listener)
.Parameters:
Name Type Description item
* The item that was added to the Process Queue.
- Since: 3.20.0
- Source: src/structs/events/PROCESS_QUEUE_ADD_EVENT.js (Line 7)
-
PROCESS_QUEUE_REMOVE
-
The Process Queue Remove Event.
This event is dispatched by a Process Queue when a new item is successfully removed from its active list.
You will most commonly see this used by a Scene's Update List when a Game Object has been removed.
In that instance, listen to this event from within a Scene using:
this.sys.updateList.on('remove', listener)
.Parameters:
Name Type Description item
* The item that was removed from the Process Queue.
- Since: 3.20.0
- Source: src/structs/events/PROCESS_QUEUE_REMOVE_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.
- 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)
-
TWEEN_ACTIVE
-
The Tween Active Event.
This event is dispatched by a Tween when it becomes active within the Tween Manager.
An 'active' Tween is one that is now progressing, although it may not yet be updating any target properties, due to settings such as
delay
. If you need an event for when the Tween starts actually updating its first property, seeTWEEN_START
.Listen to it from a Tween instance using
Tween.on('active', listener)
, i.e.:var tween = this.tweens.add({ targets: image, x: 500, ease: 'Power1', duration: 3000 }); tween.on('active', listener);
Parameters:
Name Type Description tween
Phaser.Tweens.Tween A reference to the Tween instance that emitted the event.
targets
Array.<any> An array of references to the target/s the Tween is operating on.
- Since: 3.19.0
- Source: src/tweens/events/TWEEN_ACTIVE_EVENT.js (Line 7)
-
TWEEN_COMPLETE
-
The Tween Complete Event.
This event is dispatched by a Tween when it completes playback entirely, factoring in repeats and loops.
If the Tween has been set to loop or repeat infinitely, this event will not be dispatched unless the
Tween.stop
method is called.If a Tween has a
completeDelay
set, this event will fire after that delay expires.Listen to it from a Tween instance using
Tween.on('complete', listener)
, i.e.:var tween = this.tweens.add({ targets: image, x: 500, ease: 'Power1', duration: 3000 }); tween.on('complete', listener);
Parameters:
Name Type Description tween
Phaser.Tweens.Tween A reference to the Tween instance that emitted the event.
targets
Array.<any> An array of references to the target/s the Tween is operating on.
- Since: 3.19.0
- Source: src/tweens/events/TWEEN_COMPLETE_EVENT.js (Line 7)
-
TWEEN_LOOP
-
The Tween Loop Event.
This event is dispatched by a Tween when it loops.
This event will only be dispatched if the Tween has a loop count set.
If a Tween has a
loopDelay
set, this event will fire after that delay expires.The difference between
loop
andrepeat
is thatrepeat
is a property setting, where-asloop
applies to the entire Tween.Listen to it from a Tween instance using
Tween.on('loop', listener)
, i.e.:var tween = this.tweens.add({ targets: image, x: 500, ease: 'Power1', duration: 3000, loop: 6 }); tween.on('loop', listener);
Parameters:
Name Type Description tween
Phaser.Tweens.Tween A reference to the Tween instance that emitted the event.
targets
Array.<any> An array of references to the target/s the Tween is operating on.
- Since: 3.19.0
- Source: src/tweens/events/TWEEN_LOOP_EVENT.js (Line 7)
-
TWEEN_REPEAT
-
The Tween Repeat Event.
This event is dispatched by a Tween when one of the properties it is tweening repeats.
This event will only be dispatched if the Tween has a property with a repeat count set.
If a Tween has a
repeatDelay
set, this event will fire after that delay expires.The difference between
loop
andrepeat
is thatrepeat
is a property setting, where-asloop
applies to the entire Tween.Listen to it from a Tween instance using
Tween.on('repeat', listener)
, i.e.:var tween = this.tweens.add({ targets: image, x: 500, ease: 'Power1', duration: 3000, repeat: 4 }); tween.on('repeat', listener);
Parameters:
Name Type Description tween
Phaser.Tweens.Tween A reference to the Tween instance that emitted the event.
key
string The key of the property that just repeated.
target
any The target that the property just repeated on.
- Since: 3.19.0
- Source: src/tweens/events/TWEEN_REPEAT_EVENT.js (Line 7)
-
TWEEN_START
-
The Tween Start Event.
This event is dispatched by a Tween when it starts tweening its first property.
A Tween will only emit this event once, as it can only start once.
If a Tween has a
delay
set, this event will fire after that delay expires.Listen to it from a Tween instance using
Tween.on('start', listener)
, i.e.:var tween = this.tweens.add({ targets: image, x: 500, ease: 'Power1', duration: 3000 }); tween.on('start', listener);
Parameters:
Name Type Description tween
Phaser.Tweens.Tween A reference to the Tween instance that emitted the event.
targets
Array.<any> An array of references to the target/s the Tween is operating on.
- Since: 3.19.0
- Source: src/tweens/events/TWEEN_START_EVENT.js (Line 7)
-
TWEEN_STOP
-
The Tween Stop Event.
This event is dispatched by a Tween when it is stopped.
Listen to it from a Tween instance using
Tween.on('stop', listener)
, i.e.:var tween = this.tweens.add({ targets: image, x: 500, ease: 'Power1', duration: 3000 }); tween.on('stop', listener);
Parameters:
Name Type Description tween
Phaser.Tweens.Tween A reference to the Tween instance that emitted the event.
targets
Array.<any> An array of references to the target/s the Tween is operating on.
- Since: 3.24.0
- Source: src/tweens/events/TWEEN_STOP_EVENT.js (Line 7)
-
TWEEN_UPDATE
-
The Tween Update Event.
This event is dispatched by a Tween every time it updates any of the properties it is tweening.
A Tween that is changing 3 properties of a target will emit this event 3 times per change, once per property.
Note: This is a very high frequency event and may be dispatched multiple times, every single frame.
Listen to it from a Tween instance using
Tween.on('update', listener)
, i.e.:var tween = this.tweens.add({ targets: image, x: 500, ease: 'Power1', duration: 3000, }); tween.on('update', listener);
Parameters:
Name Type Description tween
Phaser.Tweens.Tween A reference to the Tween instance that emitted the event.
key
string The property that was updated, i.e.
x
orscale
.target
any The target object that was updated. Usually a Game Object, but can be of any type.
current
number The current value of the property that was tweened.
previous
number The previous value of the property that was tweened, prior to this update.
- Since: 3.19.0
- Source: src/tweens/events/TWEEN_UPDATE_EVENT.js (Line 7)
-
TWEEN_YOYO
-
The Tween Yoyo Event.
This event is dispatched by a Tween whenever a property it is tweening yoyos.
This event will only be dispatched if the Tween has a property with
yoyo
set.If the Tween has a
hold
value, this event is dispatched when the hold expires.This event is dispatched for every property, and for every target, that yoyos. For example, if a Tween was updating 2 properties and had 10 targets, this event would be dispatched 20 times (twice per target). So be careful how you use it!
Listen to it from a Tween instance using
Tween.on('yoyo', listener)
, i.e.:var tween = this.tweens.add({ targets: image, x: 500, ease: 'Power1', duration: 3000, yoyo: true }); tween.on('yoyo', listener);
Parameters:
Name Type Description tween
Phaser.Tweens.Tween A reference to the Tween instance that emitted the event.
key
string The property that yoyo'd, i.e.
x
orscale
.target
any The target object that was yoyo'd. Usually a Game Object, but can be of any type.
- Since: 3.19.0
- Source: src/tweens/events/TWEEN_YOYO_EVENT.js (Line 7)
-
COMPLETE
-
The Complete Event.
- Since: 3.19.0
- Source: plugins/spine/src/events/COMPLETE_EVENT.js (Line 7)
-
DISPOSE
-
The Dispose Event.
- Since: 3.19.0
- Source: plugins/spine/src/events/DISPOSE_EVENT.js (Line 7)
-
END
-
The End Event.
- Since: 3.19.0
- Source: plugins/spine/src/events/END_EVENT.js (Line 7)
-
EVENT
-
The Custom Event Event.
- Since: 3.19.0
- Source: plugins/spine/src/events/EVENT_EVENT.js (Line 7)
-
INTERRUPTED
-
The Interrupted Event.
- Since: 3.19.0
- Source: plugins/spine/src/events/INTERRUPTED_EVENT.js (Line 7)
-
START
-
The Start Event.
- Since: 3.19.0
- Source: plugins/spine/src/events/START_EVENT.js (Line 7)