Interface IController

Defines a controller. Controllers are non-renderable objects who's update() method is invoked once per frame. A controller can run either for all scopes or in the scope of a scene. If a scope is defined, the Controller.update() is invoked only if the ActiveScene.Name matches the scope.

interface IController {
    id: string;
    scope: string;
    update(dt: number, activeScene: null | Scene): void;
}

Properties

Methods

Properties

id: string

The unique controller id.

scope: string

A scene name, if present activates the controller only while the scene is active. If no scope is defined the controller is active regardless of the active scene.

Methods

  • Invoked once per frame, depending on scope.

    Parameters

    • dt: number

      the elapsed time in milliseconds

    • activeScene: null | Scene

      the current scene

    Returns void