zimporter-pixi - v1.0.80
    Preparing search index...

    Class ZSceneStack

    Manages a stack of ZScene instances, providing static methods to manipulate the stack.

    This class allows pushing, popping, peeking, and clearing scenes from the stack. It also provides utility methods to spawn entities from the topmost scene and resize all scenes in the stack.

    • The stack is implemented as a static array, so all operations affect the global stack.
    • The stack size and top index are tracked separately for efficient access.
    Index

    Constructors

    Methods

    • Removes all scenes from the stack and resets the size and top-of-stack index.

      Returns void

    • Returns the current number of scenes in the stack.

      Returns number

      The stack size.

    • Returns the scene at the top of the stack without removing it.

      Returns ZScene | null

      The top ZScene, or null if the stack is empty.

    • Removes and returns the scene at the top of the stack.

      Returns ZScene | null

      The removed ZScene, or null if the stack is empty.

    • Calls resize(width, height) on every scene in the stack (top to bottom).

      Parameters

      • width: number

        The new viewport width.

      • height: number

        The new viewport height.

      Returns void

    • Searches the stack from top to bottom and calls spawn(templateName) on each scene until one returns a container instance.

      Parameters

      • templateName: string

        The template/asset name to spawn.

      Returns ZContainer | undefined

      The spawned ZContainer, or undefined if not found in any scene.