Class SceneAbstract

Represents a scene instance. Only one scene at a time is rendered.

Hierarchy

  • Container
    • Scene

Implements

Constructors

  • Creates a new scene instance.

    Parameters

    • name: string

      the scene name.

    Returns Scene

Properties

Name: string

Accessors

  • get BackGroundColor(): number
  • Gets the scene background color.

    Returns number

  • set BackGroundColor(color): void
  • Sets the scene background color.

    Parameters

    • color: number

    Returns void

  • get HudOverlay(): null | Container<ContainerChild> | Container<ContainerChild> & IUpdatable
  • Gets the scene hud overlay container.

    Returns null | Container<ContainerChild> | Container<ContainerChild> & IUpdatable

  • set HudOverlay(hud): void
  • Sets the scene hud overlay container.

    Parameters

    • hud: null | Container<ContainerChild> | Container<ContainerChild> & IUpdatable

    Returns void

  • get clear(): boolean
  • Gets the clear flag used by the PIXI renderer.

    Returns boolean

  • set clear(clearFlag): void
  • Sets the clear flag used by the PIXI renderer.

    Parameters

    • clearFlag: boolean

    Returns void

Methods

  • Adds one or more children to the container. Multiple items can be added like: myScene.addChild(childOne, childTwo, childThree)

    Type Parameters

    • T extends Container<ContainerChild>[]

    Parameters

    • Rest...child: T

      PIXI.Container

    Returns T[0]

  • Adds a child object to the scene.

    Type Parameters

    • T extends Container<ContainerChild>

    Parameters

    • child: T

      PIXI.Container

    • index: number

      position in the display object list where the child is inserted

    Returns T

  • Invokes the action on every child display object, no matter how deep they are nested.

    Parameters

    • action: ((d: Container<ContainerChild>) => void)
        • (d): void
        • Parameters

          • d: Container<ContainerChild>

          Returns void

    Returns void

  • Returns true if the scene is paused.

    Returns boolean

  • Fired every time the scene is to be activated.

    Returns void

    If a new scene is activated, currentScene.onDeactivate() is fired first followed by newScene.onActivate()

  • Fired every time the scene is deactivated. Note: this function has no implementation, override in derived class to add functionality.

    Returns void

  • Fired when the scene is destroyed. Note: this function has no implementation, override in derived class to add functionality.

    Returns void

  • Fired every time the window resizes, the scene is about to be activated (before onActivate()) and after a MasterHudOverlay is set. Note: this function has no implementation, override in derived class to add functionality.

    Returns void

    Note that this function is fired only for the current (active) scene!

  • Fired on each animation frame. Note: this function has no implementation, override in derived class to add functionality.

    Parameters

    • dt: number

      elapsed time delta

    • timestamp: number

      total time, useful for TWEEN.update and other libs depending on total time

    Returns void

  • Pauses the scene. A paused scene is not rendered and its onUpdate() events are not fired.

    Returns void

  • Invokes the action on every child display object, no matter how deep they are nested.

    Parameters

    • container: Container<ContainerChild>
    • action: ((d: Container<ContainerChild>) => void)
        • (d): void
        • Parameters

          • d: Container<ContainerChild>

          Returns void

    Returns void