Namespace: Events

Phaser.Cameras.Scene2D. Events

Events


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.

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.

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

FADE_IN_START

The Camera Fade In Start Event.

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

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

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

The camera that the effect began on.

effect Phaser.Cameras.Scene2D.Effects.Fade

A reference to the effect instance.

duration integer

The duration of the effect.

red integer

The red color channel value.

green integer

The green color channel value.

blue integer

The blue color channel value.

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.

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

FADE_OUT_START

The Camera Fade Out Start Event.

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

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

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

The camera that the effect began on.

effect Phaser.Cameras.Scene2D.Effects.Fade

A reference to the effect instance.

duration integer

The duration of the effect.

red integer

The red color channel value.

green integer

The green color channel value.

blue integer

The blue color channel value.

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.

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

FLASH_START

The Camera Flash Start Event.

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

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

The camera that the effect began on.

effect Phaser.Cameras.Scene2D.Effects.Flash

A reference to the effect instance.

duration integer

The duration of the effect.

red integer

The red color channel value.

green integer

The green color channel value.

blue integer

The blue color channel value.

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

PAN_COMPLETE

The Camera Pan Complete Event.

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

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

The camera that the effect began on.

effect Phaser.Cameras.Scene2D.Effects.Pan

A reference to the effect instance.

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

PAN_START

The Camera Pan Start Event.

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

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

The camera that the effect began on.

effect Phaser.Cameras.Scene2D.Effects.Pan

A reference to the effect instance.

duration integer

The duration of the effect.

x number

The destination scroll x coordinate.

y number

The destination scroll y coordinate.

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.

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.

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

SHAKE_COMPLETE

The Camera Shake Complete Event.

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

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

The camera that the effect began on.

effect Phaser.Cameras.Scene2D.Effects.Shake

A reference to the effect instance.

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

SHAKE_START

The Camera Shake Start Event.

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

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

The camera that the effect began on.

effect Phaser.Cameras.Scene2D.Effects.Shake

A reference to the effect instance.

duration integer

The duration of the effect.

intensity number

The intensity of the effect.

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.

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

ZOOM_START

The Camera Zoom Start Event.

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

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

The camera that the effect began on.

effect Phaser.Cameras.Scene2D.Effects.Zoom

A reference to the effect instance.

duration integer

The duration of the effect.

zoom number

The destination zoom value.

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