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.
Extends
Section titled “Extends”Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new UIPanel(
opts):UIPanel
Defined in: ui/src/UIPanel.ts:119
Parameters
Section titled “Parameters”Returns
Section titled “Returns”UIPanel
Overrides
Section titled “Overrides”Properties
Section titled “Properties”_transform
Section titled “_transform”
readonly_transform:ElementTransform
Defined in: ui/src/UIElementBase.ts:20
Internal
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”container
Section titled “container”
readonlycontainer:DisplayContainer
Defined in: ui/src/UIPanel.ts:74
yogaNode
Section titled “yogaNode”
readonlyyogaNode:Node
Defined in: ui/src/UIPanel.ts:75
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”Accessors
Section titled “Accessors”children
Section titled “children”Get Signature
Section titled “Get Signature”get children(): readonly
UIElement[]
Defined in: ui/src/UIPanel.ts:177
Returns
Section titled “Returns”readonly UIElement[]
Implementation of
Section titled “Implementation of”displayObject
Section titled “displayObject”Get Signature
Section titled “Get Signature”get displayObject():
DisplayContainer
Defined in: ui/src/UIPanel.ts:77
Returns
Section titled “Returns”DisplayContainer
Implementation of
Section titled “Implementation of”UIContainerElement.displayObject
Overrides
Section titled “Overrides”focusScope
Section titled “focusScope”Get Signature
Section titled “Get Signature”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.
Returns
Section titled “Returns”UIFocusScope | null
rotation
Section titled “rotation”Get Signature
Section titled “Get Signature”get rotation():
number
Defined in: ui/src/UIElementBase.ts:50
See LayoutProps.rotation.
Returns
Section titled “Returns”number
Set Signature
Section titled “Set Signature”set rotation(
value):void
Defined in: ui/src/UIElementBase.ts:54
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Get Signature
Section titled “Get Signature”get scale():
Readonly<{x:number;y:number; }>
Defined in: ui/src/UIElementBase.ts:41
See LayoutProps.scale.
Returns
Section titled “Returns”Readonly<{ x: number; y: number; }>
Set Signature
Section titled “Set Signature”set scale(
value):void
Defined in: ui/src/UIElementBase.ts:45
Parameters
Section titled “Parameters”number | { x: number; y: number; }
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”transformOrigin
Section titled “transformOrigin”Get Signature
Section titled “Get Signature”get transformOrigin():
Readonly<{x:number;y:number; }>
Defined in: ui/src/UIElementBase.ts:32
See LayoutProps.transformOrigin.
Returns
Section titled “Returns”Readonly<{ x: number; y: number; }>
Set Signature
Section titled “Set Signature”set transformOrigin(
value):void
Defined in: ui/src/UIElementBase.ts:36
Parameters
Section titled “Parameters”number | { x: number; y: number; }
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”visible
Section titled “visible”Get Signature
Section titled “Get Signature”get visible():
boolean
Defined in: ui/src/UIPanel.ts:291
Returns
Section titled “Returns”boolean
Set Signature
Section titled “Set Signature”set visible(
v):void
Defined in: ui/src/UIPanel.ts:295
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”zIndex
Section titled “zIndex”Get Signature
Section titled “Get Signature”get zIndex():
number
Defined in: ui/src/UIElementBase.ts:59
See LayoutProps.zIndex.
Returns
Section titled “Returns”number
Set Signature
Section titled “Set Signature”set zIndex(
value):void
Defined in: ui/src/UIElementBase.ts:63
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”_attachToTree()
Section titled “_attachToTree()”_attachToTree(
context):void
Defined in: ui/src/UIPanel.ts:224
Internal
Stamped by UISurface from the owning entity and passed down the tree.
Parameters
Section titled “Parameters”context
Section titled “context”Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”UIContainerElement._attachToTree
_detachFromTree()
Section titled “_detachFromTree()”_detachFromTree():
void
Defined in: ui/src/UIPanel.ts:233
Internal
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”UIContainerElement._detachFromTree
_inspectState()
Section titled “_inspectState()”_inspectState():
object
Defined in: ui/src/UIPanel.ts:357
Internal
focused is true only for a focusable panel.
Returns
Section titled “Returns”object
focusable
Section titled “focusable”focusable:
boolean
focused
Section titled “focused”focused:
boolean
focusScope
Section titled “focusScope”focusScope: {
hasInput:boolean; } |null
addElement()
Section titled “addElement()”addElement(
child):void
Defined in: ui/src/UIPanel.ts:181
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”applyLayout()
Section titled “applyLayout()”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.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”UIContainerElement.applyLayout
applyTransformProps()
Section titled “applyTransformProps()”
protectedapplyTransformProps(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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”UIElementBase.applyTransformProps
button()
Section titled “button()”button(
label,opts):UIButton
Defined in: ui/src/UIPanel.ts:267
Add a button element.
Parameters
Section titled “Parameters”string
Omit<UIButtonProps, "children">
Returns
Section titled “Returns”destroy()
Section titled “destroy()”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.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”insertElementBefore()
Section titled “insertElementBefore()”insertElementBefore(
child,before):void
Defined in: ui/src/UIPanel.ts:206
Parameters
Section titled “Parameters”before
Section titled “before”Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”UIContainerElement.insertElementBefore
panel()
Section titled “panel()”panel(
opts?):UIPanel
Defined in: ui/src/UIPanel.ts:274
Add a nested child panel.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”UIPanel
removeElement()
Section titled “removeElement()”removeElement(
child):void
Defined in: ui/src/UIPanel.ts:194
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”UIContainerElement.removeElement
scrollView()
Section titled “scrollView()”scrollView(
opts?):UIScrollView
Defined in: ui/src/UIPanel.ts:281
Add a nested scrollable viewport.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”text()
Section titled “text()”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.
Parameters
Section titled “Parameters”content
Section titled “content”string
style?
Section titled “style?”Partial<TextStyleOptions>
Returns
Section titled “Returns”update()
Section titled “update()”update(
props):void
Defined in: ui/src/UIPanel.ts:346
Parameters
Section titled “Parameters”Partial<UIPanelProps>
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”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.