- Source: src/scene/typedefs/index.js (Line 7)
Type Definitions
-
CreateSceneFromObjectConfig
-
Type:
- object
- Since: 3.17.0
- Source: src/scene/typedefs/CreateSceneFromObjectConfig.js (Line 1)
Properties:
Name Type Argument Description initPhaser.Types.Scenes.SceneInitCallback <optional>
The scene's init callback.
preloadPhaser.Types.Scenes.ScenePreloadCallback <optional>
The scene's preload callback.
createPhaser.Types.Scenes.SceneCreateCallback <optional>
The scene's create callback.
updatefunction <optional>
The scene's update callback. See Phaser.Scene#update.
extendany <optional>
Any additional properties, which will be copied to the Scene after it's created (except
dataorsys).Properties
Name Type Argument Description dataany <optional>
Any values, which will be merged into the Scene's Data Manager store.
-
SceneCreateCallback(data)
-
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()andpreload(). If the LoaderPlugin started afterpreload(), then this method is called only after loading is complete.Parameters:
Name Type Description dataobject Any data passed via
ScenePlugin.add()orScenePlugin.start(). Same as Scene.settings.data.- Since: 3.0.0
- Source: src/scene/typedefs/SceneCreateCallback.js (Line 1)
-
SceneInitCallback(data)
-
Can be defined on your own Scenes. This method is called by the Scene Manager when the scene starts, before
preload()andcreate().Parameters:
Name Type Description dataobject Any data passed via
ScenePlugin.add()orScenePlugin.start(). Same as Scene.settings.data.- Since: 3.0.0
- Source: src/scene/typedefs/SceneInitCallback.js (Line 1)
-
ScenePreloadCallback()
-
Can be defined on your own Scenes. Use it to load assets. This method is called by the Scene Manager, after
init()and beforecreate(), only if the Scene has a LoaderPlugin. After this method completes, if the LoaderPlugin's queue isn't empty, the LoaderPlugin will start automatically.- Since: 3.0.0
- Source: src/scene/typedefs/ScenePreloadCallback.js (Line 1)
-
SceneTransitionConfig
-
Type:
- object
- Since: 3.5.0
- Source: src/scene/typedefs/SceneTransitionConfig.js (Line 1)
Properties:
Name Type Argument Default Description targetstring The Scene key to transition to.
durationnumber <optional>
1000 The duration, in ms, for the transition to last.
sleepboolean <optional>
false Will the Scene responsible for the transition be sent to sleep on completion (
true), or stopped? (false)removeboolean <optional>
false Will the Scene responsible for the transition be removed from the Scene Manager after the transition completes?
allowInputboolean <optional>
false Will the Scenes Input system be able to process events while it is transitioning in or out?
moveAboveboolean <optional>
Move the target Scene to be above this one before the transition starts.
moveBelowboolean <optional>
Move the target Scene to be below this one before the transition starts.
onUpdatefunction <optional>
This callback is invoked every frame for the duration of the transition.
onUpdateScopeany <optional>
The context in which the callback is invoked.
dataany <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).
-
SettingsConfig
-
Type:
- object
- Since: 3.0.0
- Source: src/scene/typedefs/SettingsConfig.js (Line 1)
Properties:
Name Type Argument Default Description keystring <optional>
The unique key of this Scene. Must be unique within the entire Game instance.
activeboolean <optional>
false Does the Scene start as active or not? An active Scene updates each step.
visibleboolean <optional>
true Does the Scene start as visible or not? A visible Scene renders each step.
packfalse | Phaser.Types.Loader.FileTypes.PackFileSection <optional>
false Files to be loaded before the Scene begins.
camerasPhaser.Types.Cameras.Scene2D.JSONCamera | Array.<Phaser.Types.Cameras.Scene2D.JSONCamera> <optional>
<nullable>
null An optional Camera configuration object.
mapObject.<string, string> <optional>
Overwrites the default injection map for a scene.
mapAddObject.<string, string> <optional>
Extends the injection map for a scene.
physicsPhaser.Types.Core.PhysicsConfig <optional>
{} The physics configuration object for the Scene.
loaderPhaser.Types.Core.LoaderConfig <optional>
{} The loader configuration object for the Scene.
pluginsfalse | * <optional>
false The plugin configuration object for the Scene.
-
SettingsObject
-
Type:
- object
- Since: 3.0.0
- Source: src/scene/typedefs/SettingsObject.js (Line 1)
Properties:
Name Type Argument Description statusnumber The current status of the Scene. Maps to the Scene constants.
keystring The unique key of this Scene. Unique within the entire Game instance.
activeboolean The active state of this Scene. An active Scene updates each step.
visibleboolean The visible state of this Scene. A visible Scene renders each step.
isBootedboolean Has the Scene finished booting?
isTransitionboolean Is the Scene in a state of transition?
transitionFromPhaser.Scene <nullable>
The Scene this Scene is transitioning from, if set.
transitionDurationnumber The duration of the transition, if set.
transitionAllowInputboolean Is this Scene allowed to receive input during transitions?
dataobject a data bundle passed to this Scene from the Scene Manager.
packfalse | Phaser.Types.Loader.FileTypes.PackFileSection Files to be loaded before the Scene begins.
camerasPhaser.Types.Cameras.Scene2D.JSONCamera | Array.<Phaser.Types.Cameras.Scene2D.JSONCamera> <nullable>
The Camera configuration object.
mapObject.<string, string> The Scene's Injection Map.
physicsPhaser.Types.Core.PhysicsConfig The physics configuration object for the Scene.
loaderPhaser.Types.Core.LoaderConfig The loader configuration object for the Scene.
pluginsfalse | * The plugin configuration object for the Scene.
