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
constructor(position: Position2d);constructor(
children: UIObject[],
padding: Size2d,
position: Position2d,
);Properties
maxSize
maxSize: Size2d;padding
padding: Size2d;children
children: UIObject[];position
position: Position3d;horizontalAlignment
horizontalAlignment: ElementAlignment;verticalAlignment
verticalAlignment: ElementAlignment;anchor
anchor: LayoutAnchor;style
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;