Home Reference Source Test
import {_SceneManager} from 'seed-engine/src/manager/SceneManager.js'
private class | source

_SceneManager

You can directly use an instance of this class. SceneManager

Extends:

Manager → _SceneManager

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

addScene(scene: Scene)

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

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

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
public

update()

Public Constructors

public constructor() source

Override:

Manager#constructor

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:

NameTypeAttributeDescription
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#end

public getCurrentScene(): * source

Gets the current scene on the stack. This scene will be the one currently used in the update loop.

Return:

*

public pause() source

Pauses the current scene.

Override:

Manager#pause

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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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 start() source

Starts the current scene on the stack.

Override:

Manager#start

public unpause() source

Unpauses the current scene.

Override:

Manager#unpause

public update() source

Updates the current scene and all SceneObjects that are assigned to that scene.

Override:

Manager#update