_SceneManager
Extends:
A manager which manages all scenes and passes commands to the current scene.
Manages scenes on a stack, pausing scenes below them (stopping rendering), and managing the top scene for triggering updates on all objects on the scene.
GameObjects, components, or anything else can use the SceneManager to reference the current active scene. There are also wrapper functions for passing SceneObjects and Viewports to the current scene for registration with that scene.
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Public Members | ||
public |
scenes: *[] |
Method Summary
Public Methods | ||
public |
Adds the new scene to the top of the stack, pausing the current scene first. |
|
public |
end() Ends all scenes, starting from the top & poping each scene off the stack as it goes. |
|
public |
getCurrentScene(): * Gets the current scene on the stack. |
|
public |
pause() Pauses the current scene. |
|
public |
registerSceneObject(sceneObject: SceneObject): * Adds a SceneObject to the current scene on the stack. |
|
public |
registerViewport(viewport: viewport): * Addsa viewport to the current scene on the stack. |
|
public |
Removes the top scene from the stack, calls its end() function, and unpauses the scene below it. |
|
public |
start() Starts the current scene on the stack. |
|
public |
unpause() Unpauses the current scene. |
|
public |
update() Updates the current scene and all SceneObjects that are assigned to that scene. |
Inherited Summary
From class Manager | ||
public |
end() |
|
public |
pause() |
|
public |
start() |
|
public |
unpause() |
|
public |
update() |
Public Constructors
Public Members
public scenes: *[] source
Public Methods
public addScene(scene: Scene) source
Adds the new scene to the top of the stack, pausing the current scene first.
Params:
Name | Type | Attribute | Description |
scene | Scene | The new scene. |
public end() source
Ends all scenes, starting from the top & poping each scene off the stack as it goes.
Override:
Manager#endpublic getCurrentScene(): * source
Gets the current scene on the stack. This scene will be the one currently used in the update loop.
Return:
* |
public registerSceneObject(sceneObject: SceneObject): * source
Adds a SceneObject to the current scene on the stack. The scene will hold reference and manage the SceneObject.
Params:
Name | Type | Attribute | Description |
sceneObject | SceneObject | The SceneObject that is being registered. |
Return:
* |
public registerViewport(viewport: viewport): * source
Addsa viewport to the current scene on the stack. The scene will hold reference to the viewport.
Params:
Name | Type | Attribute | Description |
viewport | viewport | The Viewport that is being registered. |
Return:
* |
public removeScene() source
Removes the top scene from the stack, calls its end() function, and unpauses the scene below it.
public update() source
Updates the current scene and all SceneObjects that are assigned to that scene.