mwg API
    Preparing search index...

    Class Scene2DAbstract

    A scene that draws through Pixi: core.Scene's lifecycle plus the container everything this screen shows hangs off.

    This is what a 2D game extends. The container is destroyed with the scene, so a scene may add whatever it likes to stage without tracking it for cleanup. The base class holds the lifecycle alone precisely so that core.SceneStack can drive a Babylon scene just as well as this one - the stack calls create, resize, onSuspend, onResume and destroy, and never touches stage.

    Hierarchy (View Summary)

    Index
    onDestroy: Signal<void> = ...

    fires when the scene is torn down, for listeners that need to detach

    stage: Container = ...

    everything this scene draws hangs off here

    • get isDestroyed(): boolean

      Returns boolean

    • builds the scene's contents; assets are already loaded when this runs

      Returns void

    • Called when the scene above pops, reporting back what it decided.

      Parameters

      • _result: unknown

      Returns void

    • Called when another scene is pushed on top of this one.

      Updating already stops on its own - only the top scene runs - but input listeners do not stand down by themselves. A scene holding windows, music or key handlers pauses or detaches them here; the default does nothing.

      Returns void

    • the display was resized; the scene may relayout rather than be rebuilt

      Parameters

      • _width: number
      • _height: number

      Returns void

    • Renderer-owned resources this scene holds, released exactly once as it is destroyed.

      The base owns none, because it owns no renderer; two-d.Scene2D destroys its container here. A subclass overriding it does not need to call super.teardown().

      Returns void