Skip to content

UIPanel

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

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:119

UIPanelProps

UIPanel

UIElementBase.constructor

readonly _transform: ElementTransform

Defined in: ui/src/UIElementBase.ts:20

Internal

UIContainerElement._transform

UIElementBase._transform


readonly container: DisplayContainer

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


readonly yogaNode: Node

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

UIContainerElement.yogaNode

UIElementBase.yogaNode

get children(): readonly UIElement[]

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

readonly UIElement[]

UIContainerElement.children


get displayObject(): DisplayContainer

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

DisplayContainer

UIContainerElement.displayObject

UIElementBase.displayObject


get focusScope(): UIFocusScope | null

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

The focus scope this panel owns, or null when it carries no focus option. A panel built before its tree is mounted gets its scope when the tree is mounted.

UIFocusScope | null


get rotation(): number

Defined in: ui/src/UIElementBase.ts:50

See LayoutProps.rotation.

number

set rotation(value): void

Defined in: ui/src/UIElementBase.ts:54

number

void

UIElementBase.rotation


get scale(): Readonly<{ x: number; y: number; }>

Defined in: ui/src/UIElementBase.ts:41

See LayoutProps.scale.

Readonly<{ x: number; y: number; }>

set scale(value): void

Defined in: ui/src/UIElementBase.ts:45

number | { x: number; y: number; }

void

UIElementBase.scale


get transformOrigin(): Readonly<{ x: number; y: number; }>

Defined in: ui/src/UIElementBase.ts:32

See LayoutProps.transformOrigin.

Readonly<{ x: number; y: number; }>

set transformOrigin(value): void

Defined in: ui/src/UIElementBase.ts:36

number | { x: number; y: number; }

void

UIElementBase.transformOrigin


get visible(): boolean

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

boolean

set visible(v): void

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

boolean

void

UIContainerElement.visible

UIElementBase.visible


get zIndex(): number

Defined in: ui/src/UIElementBase.ts:59

See LayoutProps.zIndex.

number

set zIndex(value): void

Defined in: ui/src/UIElementBase.ts:63

number

void

UIElementBase.zIndex

_attachToTree(context): void

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

Internal

Stamped by UISurface from the owning entity and passed down the tree.

UITreeContext

void

UIContainerElement._attachToTree


_detachFromTree(): void

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

Internal

void

UIContainerElement._detachFromTree


_inspectState(): object

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

Internal

focused is true only for a focusable panel.

object

focusable: boolean

focused: boolean

focusScope: { hasInput: boolean; } | null


addElement(child): void

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

UIElement

void

UIContainerElement.addElement


applyLayout(): void

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

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

void

UIContainerElement.applyLayout


protected applyTransformProps(props): void

Defined in: ui/src/UIElementBase.ts:27

Apply the four transform props present in props. A present key holding undefined resets that prop to its default. Throws before writing anything if a value is not finite.

LayoutProps

void

UIElementBase.applyTransformProps


button(label, opts): UIButton

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

Add a button element.

string

Omit<UIButtonProps, "children">

UIButton


destroy(): void

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

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

UIElementBase.destroy


insertElementBefore(child, before): void

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

UIElement

UIElement

void

UIContainerElement.insertElementBefore


panel(opts?): UIPanel

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

Add a nested child panel.

UIPanelProps

UIPanel


removeElement(child): void

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

UIElement

void

UIContainerElement.removeElement


scrollView(opts?): UIScrollView

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

Add a nested scrollable viewport.

UIScrollViewProps

UIScrollView


text(content, style?, opts?): UIText

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

Add a text element. opts carries the rest of UITextProps — bitmap, resolution, truncate, layout props — so the builder reaches everything the UIText constructor does.

string

Partial<TextStyleOptions>

UITextBuilderProps

UIText


update(props): void

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

Partial<UIPanelProps>

void

UIContainerElement.update

UIElementBase.update

Coding agents: fetch https://yage.dev/llms.txt first and prefer the Markdown references it links over these HTML pages. This page's Markdown counterpart is /llms/packages/ui.md.