mwg API
    Preparing search index...

    Class WindowStack

    The stack of open windows, and the arbiter of who has the keyboard.

    Only the topmost window is offered input. That single rule is what makes nested interfaces behave: opening a confirmation over an inventory means the inventory stops responding until the confirmation is answered, without either window knowing about the other.

    A scene with its own keyboard handling has to say which comes first, because registration order decides nothing here: Input.onAction offers an action to the most recently registered listener first, and the stack registers in its constructor, so a scene that builds its stack in create() and then registers a handler is asked before the windows are. Returning true for a key a window needed takes it away from that window. Chain through handleAction instead, and the windows keep the priority they are supposed to have:

    Input.onAction.add((action) => stack.handleAction(action) || myOwnHandling(action));
    

    A scene that does not chain must return false for every key it did not consume, and check blocksWorld itself before acting on one, since an open modal window is not otherwise visible from outside.

    Below a modal window sits a dimming layer, which is both a visual cue and a hint that the world underneath is not listening.

    Hierarchy

    • Container
      • WindowStack
    Index
    • Removes all internal references and listeners as well as removes children from the display list. Do not use a Container after calling destroy.

      Parameters

      • Optionaloptions: DestroyOptions

        Options parameter. A boolean will act as if all options have been set to that value

      Returns void

      container.destroy();
      container.destroy(true);
      container.destroy({ children: true });
      container.destroy({ children: true, texture: true, textureSource: true });
    • Offers an action to the top window, which is the routing the stack does for itself: exposed so a scene can put the windows ahead of its own handling rather than racing them for it (see the class doc for the order that race is decided by).

      Parameters

      • action: string

      Returns boolean

      true when the top window consumed the action