Phaser API Documentation

  Version: 
Event: TRANSITION_INIT
Phaser.Scenes.Events.TRANSITION_INIT
TRANSITION_INIT

Description:

The Scene Transition Init Event.

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

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

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

The Scene Transition event flow is as follows:

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

Parameters:

name type description
from Phaser.Scene

A reference to the Scene that is being transitioned from.

duration number

The duration of the transition in ms.

Since: 3.5.0