Scene

 

Props

NameTypeDefaultDescription
key*
string

The unique key of this Scene. Must be unique within the entire Game instance.

active
boolean

Does the Scene start as active or not? An active Scene updates each step.

assets
Assets

An object describing the assets to preload for the scene. This can be used instead of or in addition to preload.

cameras
JSONCamera JSONCamera[]

An optional Camera configuration object.

create
(scene: Scene) => any

Called after init and preload. Use this to create any other assets needed by the scene (animations, etc).

init
(scene: Scene) => any

Called before preload and create

loader
LoaderConfig

The loader configuration object for the Scene.

map
{ [key: string]: string; }

Overwrites the default injection map for a scene.

mapAdd
{ [key: string]: string; }

Extends the injection map for a scene.

pack
false PackFileSection

Files to be loaded before the Scene begins.

physics
PhysicsConfig

The physics configuration object for the Scene.

plugins
any

The plugin configuration object for the Scene.

preload
(scene: Scene) => any

Called after init and before create. Use this to load any additional assets.

ref
Ref

 

update
(scene: Scene) => any

Called with the Scene Manager update loop

visible
boolean

Does the Scene start as visible or not? A visible Scene renders each step.