Class SceneManager

Handles multiple scenes, scene activation, rendering and updates.

Constructors

  • Creates a new SceneManager instance.

    Parameters

    • pixiApplication: Application<Renderer>

      the initialized PIXI Application

    • OptionaldesignWidth: number

      the design width, if undefined the window.innerWidth is used

    • OptionaldesignHeight: number

      the design height, if undefined the window.innerHeight is used

    • OptionalscreenSizeCalculator: IScreenSizeCalculator

      custom screen size calculator implementation, if undefined the default is used

    Returns SceneManager

    The DefaultScreenSizeCalculator returns screen dimensions that horizontally fit in available screen space but preserve the aspect ratio of the given width and height values.

Accessors

  • get Application(): Application<Renderer>
  • Returns the PIXI.Application instance.

    Returns Application<Renderer>

  • get MasterHudOverlay(): Container<ContainerChild> | Container<ContainerChild> & IResizable & IUpdatable
  • Gets the master HUD overlay container.

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

  • set MasterHudOverlay(hud): void
  • Sets the master HUD overlay container. Note: in order to set a master hud overlay, a scene must be active.

    Parameters

    Returns void

Methods

  • Activates a scene.

    Parameters

    • sceneOrName: string | Scene

      the scene instance or scene name

    Returns void

  • Cancels the animationFrame loop, removes all scenes and finally destroys the renderer.

    Returns void

  • Returns true if the named scene exists.

    Parameters

    • name: string

      the scene name

    Returns boolean

  • Removes a controller.

    Parameters

    • controllerOrId: string | IController

      the controller name or instance to be removed.

    Returns void

  • Adds a modal dialog over the scene.

    Parameters

    • dialog: Container<ContainerChild>

    Returns void