Phaser API Documentation

  Version: 
Filter
This is a beta release of our new docs system. Found an issue?
Please tell us about it in the #📖-newdocs-feedback channel on the Phaser Discord
Namespace: Events
Phaser.Cameras.Scene2D.Events

Events

DESTROY
Focus
Focus

Description:

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

Description:

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.

Focus
Focus
FADE_IN_START
Focus
Focus

Description:

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

Description:

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.

Focus
Focus
FADE_OUT_START
Focus
Focus

Description:

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

Description:

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

Description:

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

Description:

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

Description:

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

Description:

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

Description:

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

Description:

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

Description:

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

Description:

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

Description:

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

Description:

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

Description:

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

Description:

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