API Referencegraphite
Stack
Overlapping layout of UI children with horizontal and vertical alignment.
Module: graphite
Overlapping layout of UI children with horizontal and vertical alignment.
Declaration
export class Stack extends UIObject { ... }Extends: UIObject
Constructors
Creates a new stack.
constructor(position: Position2d);Creates a new stack.
constructor(
children: UIObject[],
padding: Size2d,
position: Position2d,
);Properties
maxSize
The maximum size.
maxSize: Size2d;padding
The padding.
padding: Size2d;children
The child elements managed by this layout.
children: UIObject[];position
The position in world space.
position: Position3d;horizontalAlignment
The horizontal alignment.
horizontalAlignment: ElementAlignment;verticalAlignment
The vertical alignment.
verticalAlignment: ElementAlignment;anchor
The anchor.
anchor: LayoutAnchor;style
The style applied to this layout.
style: UIStyle;Methods
addChild
Appends a child element to the layout.
addChild(child: UIObject): void;setChildren
Replaces the layout's child elements.
setChildren(children: UIObject[]): void;getSize
Returns the current dimensions.
override getSize(): Size2d;getScreenPosition
Returns the UI element's screen-space position.
override getScreenPosition(): Position2d;setScreenPosition
Sets the UI element's screen-space position.
override setScreenPosition(position: Position2d): void;setStyle
Applies a style to the element.
setStyle(style: UIStyle): Column;