name | type | arguments | description |
---|---|---|---|
init | Phaser.Types.Scenes.SceneInitCallback | <optional> |
The scene's init callback. |
preload | Phaser.Types.Scenes.ScenePreloadCallback | <optional> |
The scene's preload callback. |
create | Phaser.Types.Scenes.SceneCreateCallback | <optional> |
The scene's create callback. |
update | Phaser.Types.Scenes.SceneUpdateCallback | <optional> |
The scene's update callback. See Phaser.Scene#update. |
extend | any | <optional> |
Any additional properties, which will be copied to the Scene after it's created (except |
extend.data | any | <optional> |
Any values, which will be merged into the Scene's Data Manager store. |
Can be defined on your own Scenes. Use it to create your game objects.
This method is called by the Scene Manager when the scene starts, after init()
and preload()
.
If the LoaderPlugin started after preload()
, then this method is called only after loading is complete.
name | type | description |
---|---|---|
data | object |
Any data passed via |
Can be defined on your own Scenes.
This method is called by the Scene Manager when the scene starts, before preload()
and create()
.
name | type | description |
---|---|---|
data | object |
Any data passed via |
Can be defined on your own Scenes. Use it to load assets.
This method is called by the Scene Manager, after init()
and before create()
, only if the Scene has a LoaderPlugin.
After this method completes, if the LoaderPlugin's queue isn't empty, the LoaderPlugin will start automatically.
name | type | arguments | Default | description |
---|---|---|---|---|
target | string |
The Scene key to transition to. |
||
duration | number | <optional> | 1000 |
The duration, in ms, for the transition to last. |
sleep | boolean | <optional> | false |
Will the Scene responsible for the transition be sent to sleep on completion ( |
remove | boolean | <optional> | false |
Will the Scene responsible for the transition be removed from the Scene Manager after the transition completes? |
allowInput | boolean | <optional> | false |
Will the Scenes Input system be able to process events while it is transitioning in or out? |
moveAbove | boolean | <optional> |
Move the target Scene to be above this one before the transition starts. |
|
moveBelow | boolean | <optional> |
Move the target Scene to be below this one before the transition starts. |
|
onUpdate | function | <optional> |
This callback is invoked every frame for the duration of the transition. |
|
onUpdateScope | any | <optional> |
The context in which the callback is invoked. |
|
onStart | Phaser.Types.Scenes.SceneTransitionOnStartCallback | <optional> |
This callback is invoked when transition starting. |
|
onStartScope | any | <optional> |
The context in which the callback is invoked. |
|
data | any | <optional> |
An object containing any data you wish to be passed to the target scene's init / create methods (if sleep is false) or to the target scene's wake event callback (if sleep is true). |
name | type | arguments | Default | description |
---|---|---|---|---|
fromScene | Phaser.Scene |
Scene instance to transition from. |
||
toScene | Phaser.Scene |
Scene instance to transition to. |
name | type | arguments | Default | description |
---|---|---|---|---|
duration | number | <optional> | 1000 |
The duration, in ms, for the transition to last. |
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. |
name | type | arguments | Default | description |
---|---|---|---|---|
key | string | <optional> |
The unique key of this Scene. Must be unique within the entire Game instance. |
|
active | boolean | <optional> | false |
Does the Scene start as active or not? An active Scene updates each step. |
visible | boolean | <optional> | true |
Does the Scene start as visible or not? A visible Scene renders each step. |
pack | false | Phaser.Types.Loader.FileTypes.PackFileSection | <optional> | false |
Files to be loaded before the Scene begins. |
cameras | Phaser.Types.Cameras.Scene2D.CameraConfig | Array.<Phaser.Types.Cameras.Scene2D.CameraConfig> | <optional> | null |
An optional Camera configuration object. |
map | Object.<string, string> | <optional> |
Overwrites the default injection map for a scene. |
|
mapAdd | Object.<string, string> | <optional> |
Extends the injection map for a scene. |
|
physics | Phaser.Types.Core.PhysicsConfig | <optional> | {} |
The physics configuration object for the Scene. |
loader | Phaser.Types.Core.LoaderConfig | <optional> | {} |
The loader configuration object for the Scene. |
plugins | false | * | <optional> | false |
The plugin configuration object for the Scene. |
name | type | description |
---|---|---|
status | number |
The current status of the Scene. Maps to the Scene constants. |
key | string |
The unique key of this Scene. Unique within the entire Game instance. |
active | boolean |
The active state of this Scene. An active Scene updates each step. |
visible | boolean |
The visible state of this Scene. A visible Scene renders each step. |
isBooted | boolean |
Has the Scene finished booting? |
isTransition | boolean |
Is the Scene in a state of transition? |
transitionFrom | Phaser.Scene |
The Scene this Scene is transitioning from, if set. |
transitionDuration | number |
The duration of the transition, if set. |
transitionAllowInput | boolean |
Is this Scene allowed to receive input during transitions? |
data | object |
a data bundle passed to this Scene from the Scene Manager. |
pack | false | Phaser.Types.Loader.FileTypes.PackFileSection |
Files to be loaded before the Scene begins. |
cameras | Phaser.Types.Cameras.Scene2D.CameraConfig | Array.<Phaser.Types.Cameras.Scene2D.CameraConfig> |
The Camera configuration object. |
map | Object.<string, string> |
The Scene's Injection Map. |
physics | Phaser.Types.Core.PhysicsConfig |
The physics configuration object for the Scene. |
loader | Phaser.Types.Core.LoaderConfig |
The loader configuration object for the Scene. |
plugins | false | * |
The plugin configuration object for the Scene. |