Home Reference Source Test
import Scene from 'seed-engine/src/scene/Scene.js'
public class | source

Scene

Extends:

Updateable → Scene

Direct Subclass:

BasicScene

Baseclass for all scenes. When creating a new scene, it should inherit this class. Scenes keep track of their scene objects and viewports. The scene baseclass has functions for registering these with the scene.

Constructor Summary

Public Constructor
public

Builds the SceneObjects and Viewports list.

Member Summary

Public Members
public
public
public

viewports: *[]

Method Summary

Public Methods
public

registerRenderableComponent(renderable: Renderable, viewportIndex: number): *

Registers a Renderable component with the viewport, by index.

public

registerSceneObject(sceneObject: SceneObject): *

When a SceneObject is created, it is routed through the SceneManager to the current active scene to this function.

public

registerViewport(viewport: Viewport): *

When a Viewport is created, it is routed through the SceneManager to the current active scene to this function.

Inherited Summary

From class Updateable
public
public
public
public

id: *

public

Cleanup code for when destroying an Updateable.

public

end()

Base call function for when this Updateable is to be ended.

public

onEnd()

Called when the object is being removed or cleaned up from usage.

public

Called when the object is intended to be paused.

public

Called when the the object is first introduced.

public

Called when the object is to be unpaused from paused state.

public

Called on every update within the game, once the object has had onStart called.

public

pause()

Base call function for when this Updateable is to be paused.

public

start()

Base call function for when this Updateable is to be started.

public

Base call function for when this Updateable is to be unpaused.

public

update()

Base call function for when this Updateable is to be updated.

Public Constructors

public constructor() source

Builds the SceneObjects and Viewports list.

Override:

Updateable#constructor

Public Members

public sceneObjects: *[] source

public viewportIDCounter: number source

public viewports: *[] source

Public Methods

public registerRenderableComponent(renderable: Renderable, viewportIndex: number): * source

Registers a Renderable component with the viewport, by index.

Params:

NameTypeAttributeDescription
renderable Renderable

A Renderable to register to the viewport.

viewportIndex number

The index of the viewport.

Return:

*

public registerSceneObject(sceneObject: SceneObject): * source

When a SceneObject is created, it is routed through the SceneManager to the current active scene to this function. The SceneObject will register with the scene to be referenced on update/pause/destruct calls on a scene specific basis.

Params:

NameTypeAttributeDescription
sceneObject SceneObject

A SceneObject to register.

Return:

*

public registerViewport(viewport: Viewport): * source

When a Viewport is created, it is routed through the SceneManager to the current active scene to this function. The Viewport will register with the scene to be referenced by the RenderManager and assigned to by Renderables.

Params:

NameTypeAttributeDescription
viewport Viewport

A Viewport to register.

Return:

*