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.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new UIPanel(
opts):UIPanel
Defined in: ui/src/UIPanel.ts:96
Parameters
Section titled “Parameters”Returns
Section titled “Returns”UIPanel
Properties
Section titled “Properties”container
Section titled “container”
readonlycontainer:DisplayContainer
Defined in: ui/src/UIPanel.ts:66
yogaNode
Section titled “yogaNode”
readonlyyogaNode:Node
Defined in: ui/src/UIPanel.ts:67
Implementation of
Section titled “Implementation of”Accessors
Section titled “Accessors”children
Section titled “children”Get Signature
Section titled “Get Signature”get children(): readonly
UIElement[]
Defined in: ui/src/UIPanel.ts:112
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:69
Returns
Section titled “Returns”DisplayContainer
Implementation of
Section titled “Implementation of”UIContainerElement.displayObject
visible
Section titled “visible”Get Signature
Section titled “Get Signature”get visible():
boolean
Defined in: ui/src/UIPanel.ts:187
Returns
Section titled “Returns”boolean
Set Signature
Section titled “Set Signature”set visible(
v):void
Defined in: ui/src/UIPanel.ts:191
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”addElement()
Section titled “addElement()”addElement(
child):void
Defined in: ui/src/UIPanel.ts:116
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:204
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
button()
Section titled “button()”button(
label,opts):UIButton
Defined in: ui/src/UIPanel.ts:163
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: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.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”insertElementBefore()
Section titled “insertElementBefore()”insertElementBefore(
child,before):void
Defined in: ui/src/UIPanel.ts:130
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:170
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:122
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:177
Add a nested scrollable viewport.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”text()
Section titled “text()”text(
content,style?):UIText
Defined in: ui/src/UIPanel.ts:154
Add a text element.
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:232
Parameters
Section titled “Parameters”Partial<UIPanelProps>
Returns
Section titled “Returns”void