Bitbybit Docs
    Preparing search index...

    Class BabylonGuiStackPanel

    A stack panel lays its child controls out one after another, top to bottom or left to right, with a spacing between them, and is the usual way to build a column of controls. Add it to a GUI texture and its children to it with container.addControls.

    Index

    Constructors

    create

    • Creates a panel that stacks its children vertically, or horizontally when isVertical is false, with spacing pixels between them.

      Give a vertical panel a width and a horizontal one a height; the other size grows with the children.

      Parameters

      • inputs: CreateStackPanelDto

        The name, the direction, the spacing, the optional sizes and the colors

      Returns StackPanel

      The stack panel

      const panel = bitbybit.babylon.gui.stackPanel.createStackPanel({ name: "panel", isVertical: true, spacing: 8, width: "300px", height: "400px", color: "#00000000", background: "#00000055" });
      ui.addControl(panel);

    get

    • Reads whether a stack panel stacks its children top to bottom.

      Parameters

      Returns boolean

      True when the panel is vertical

    • Reads the gap in pixels between the children of a stack panel.

      Parameters

      Returns number

      The spacing

    • Reads the width of a stack panel, as a pixel string or a fraction.

      Parameters

      Returns string | number

      The width

    • Reads the height of a stack panel, as a pixel string or a fraction.

      Parameters

      Returns string | number

      The height

    set

    • Switches a stack panel between stacking its children top to bottom, when true, and left to right.

      Parameters

      Returns StackPanel

      The same stack panel

    • Sets the gap in pixels between the children of a stack panel.

      Parameters

      Returns StackPanel

      The same stack panel

    • Sets the width of a stack panel, as a pixel string or a fraction of the parent; a horizontal panel sizes its width from its children instead.

      Parameters

      Returns StackPanel

      The same stack panel

    • Sets the height of a stack panel, as a pixel string or a fraction of the parent; a vertical panel sizes its height from its children instead.

      Parameters

      Returns StackPanel

      The same stack panel