A scene is a level, screen, or world that can be loaded at any point during runtime.
You can provide the Scene constructor's config object with a layers array, containing data for generating layers in the scene. Each scene will automatically populate a layer with label "system" if none of the layer configurations in the config.layers array use that label.
new Scene(runtime, config);
runtime—RuntimeThe main runtime object.config—ObjectThe scene configuration object.config.label—stringTheScene's label.config.layers—Array<Object>An optional array of configuration objects for each layer in theScene.config.layers[].label—stringThe layer's label.config.layers[].parallax—Array<number>Optional parallax data, where the format is [integer, integer]. ([1, 1]is 100% parallax,[0, 0]is 0% parallax)config.layers[].gameObjectConstructors—Array<function>Optional callback functions that returnGameObjects for this layer.config.layers[].gameObjectConstructors[]—functionA callback function, passed thisSceneas an argument, that return an instance ofGameObject. ThisGameObjectis automatically added to the constructedLayer.config.onLoad—functionA callback (passed thisSceneas an argument) that runs when theScenehas finished loading.config.onTick—functionA callback (passed thisSceneas an argument) that runs every frame that thisSceneis loaded.
This scene's LayerManager instance.
This scene's Camera instance.
Get the camera associated with this scene.
CameraThe camera object for the scene.
Validates a scene configuration file and throws an error if it is invalid.
config—ObjectThe config object to validate.