Skip to content

UIPanel

Defined in: ui/src/UIPanel.ts:65

Flex container element — both the root of a UISurface’s mounted tree and any nested child panel. Manages a Yoga container node, a PixiJS Container, optional background, and an ordered list of UIElement children.

new UIPanel(opts): UIPanel

Defined in: ui/src/UIPanel.ts:96

UIPanelProps

UIPanel

readonly container: DisplayContainer

Defined in: ui/src/UIPanel.ts:66


readonly yogaNode: Node

Defined in: ui/src/UIPanel.ts:67

UIContainerElement.yogaNode

get children(): readonly UIElement[]

Defined in: ui/src/UIPanel.ts:112

readonly UIElement[]

UIContainerElement.children


get displayObject(): DisplayContainer

Defined in: ui/src/UIPanel.ts:69

DisplayContainer

UIContainerElement.displayObject


get visible(): boolean

Defined in: ui/src/UIPanel.ts:187

boolean

set visible(v): void

Defined in: ui/src/UIPanel.ts:191

boolean

void

UIContainerElement.visible

addElement(child): void

Defined in: ui/src/UIPanel.ts:116

UIElement

void

UIContainerElement.addElement


applyLayout(): void

Defined in: ui/src/UIPanel.ts:204

Recursively apply Yoga computed layout to PixiJS positions. Call this after yogaNode.calculateLayout() on the root.

void

UIContainerElement.applyLayout


button(label, opts): UIButton

Defined in: ui/src/UIPanel.ts:163

Add a button element.

string

Omit<UIButtonProps, "children">

UIButton


destroy(): void

Defined in: ui/src/UIPanel.ts:339

Frees the Yoga node and destroys the Pixi container, recursing into children. Idempotent — a second call is a no-op — because both the React reconciler (on unmount) and a caller holding a direct reference may end up calling this on the same instance.

void

UIContainerElement.destroy


insertElementBefore(child, before): void

Defined in: ui/src/UIPanel.ts:130

UIElement

UIElement

void

UIContainerElement.insertElementBefore


panel(opts?): UIPanel

Defined in: ui/src/UIPanel.ts:170

Add a nested child panel.

UIPanelProps

UIPanel


removeElement(child): void

Defined in: ui/src/UIPanel.ts:122

UIElement

void

UIContainerElement.removeElement


scrollView(opts?): UIScrollView

Defined in: ui/src/UIPanel.ts:177

Add a nested scrollable viewport.

UIScrollViewProps

UIScrollView


text(content, style?): UIText

Defined in: ui/src/UIPanel.ts:154

Add a text element.

string

Partial<TextStyleOptions>

UIText


update(props): void

Defined in: ui/src/UIPanel.ts:232

Partial<UIPanelProps>

void

UIContainerElement.update