Skip to content

PixiUIBase

Defined in: ui/src/pixi-ui/PixiUIBase.ts:40

Abstract base class for wrapping @pixi/ui components as Yoga-aware UIElements.

Handles: Yoga node + measure function, prevProps storage, bridgeSignal helper, visible prop, applyLayout, hover fan-out, focus, and destroy cleanup.

The widget view sits inside a plain container, displayObject, whose own space is measured in layout pixels. A widget that layout sizes is stretched inside that container, so the element’s scale and rotation stay the game’s.

T extends DisplayContainer

new PixiUIBase<T>(view, props): PixiUIBase<T>

Defined in: ui/src/pixi-ui/PixiUIBase.ts:73

T

LayoutProps & PointerEventProps & FocusProps & ConsumeInputProps

PixiUIBase<T>

UIElementBase.constructor

readonly _transform: ElementTransform

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

Internal

UIElementBase._transform


readonly displayObject: DisplayContainer

Defined in: ui/src/pixi-ui/PixiUIBase.ts:43

UIElementBase.displayObject


protected prevProps: Record<string, unknown> = {}

Defined in: ui/src/pixi-ui/PixiUIBase.ts:46


protected readonly view: T

Defined in: ui/src/pixi-ui/PixiUIBase.ts:45


readonly yogaNode: Node

Defined in: ui/src/pixi-ui/PixiUIBase.ts:44

UIElementBase.yogaNode

get disabled(): boolean

Defined in: ui/src/pixi-ui/PixiUIBase.ts:199

Whether the widget refuses the pointer and a confirm press. Only a widget whose @pixi/ui view carries an enabled flag reports true.

boolean


get focusable(): boolean

Defined in: ui/src/pixi-ui/PixiUIBase.ts:222

Whether the widget takes part in focus navigation.

boolean


get focused(): boolean

Defined in: ui/src/pixi-ui/PixiUIBase.ts:204

Whether the widget holds focus in the scope that owns it.

boolean


get protected hovered(): boolean

Defined in: ui/src/pixi-ui/PixiUIBase.ts:209

Whether the pointer is over the widget.

boolean


get protected interactive(): boolean

Defined in: ui/src/pixi-ui/PixiUIBase.ts:191

Whether the wrapped widget answers the player. One that only displays a value keeps its view’s own event mode and stays out of navigation unless focusable asks for it.

boolean


get protected pressed(): boolean

Defined in: ui/src/pixi-ui/PixiUIBase.ts:217

Whether any device is holding the widget down: the pointer, a confirm press from a focus scope, or both.

boolean


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/pixi-ui/PixiUIBase.ts:64

boolean

set visible(v): void

Defined in: ui/src/pixi-ui/PixiUIBase.ts:68

boolean

void

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

_inspectState(): object

Defined in: ui/src/pixi-ui/PixiUIBase.ts:399

Internal

object

disabled: boolean

focusable: boolean

focused: boolean


abstract activate(): void

Defined in: ui/src/pixi-ui/PixiUIBase.ts:231

Run the widget’s own action, as a confirm press or a click does. A widget that is stepped rather than pressed implements this as a no-op and carries adjust.

void


protected optional adjust(direction): boolean

Defined in: ui/src/pixi-ui/PixiUIBase.ts:249

Step the widget’s own value along direction, returning true only when the press was consumed. A stepper at its end returns false, so the press moves focus out of the widget.

FocusDirection

boolean


applyLayout(): void

Defined in: ui/src/pixi-ui/PixiUIBase.ts:308

void


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


protected bridgeSignal<F>(signal, key, kind, newProps): void

Defined in: ui/src/pixi-ui/PixiUIBase.ts:317

Bridge a @pixi/ui Signal to a callback prop. Only reconnects if ref changed.

F extends (…args) => void

(cb) => void

(cb) => void

string

string

Record<string, unknown>

void


destroy(): void

Defined in: ui/src/pixi-ui/PixiUIBase.ts:407

void

UIElementBase.destroy


abstract protected disconnectAll(): void

Defined in: ui/src/pixi-ui/PixiUIBase.ts:454

Override in subclass to disconnect all signals on destroy.

void


protected disconnectBridgedSignal<F>(signal, key): void

Defined in: ui/src/pixi-ui/PixiUIBase.ts:353

F extends (…args) => void

(cb) => void

string

void


protected focusOutlineBox(): UIFocusOutlineBox

Defined in: ui/src/pixi-ui/PixiUIBase.ts:281

The rectangle the focus outline is drawn around, in this element’s own space, which is measured in layout pixels.

A widget layout sizes is outlined around both its layout box and everything it draws, so a part reaching outside the box is inside the outline. A widget that keeps its own size is outlined around what it draws. A widget whose drawn extent moves with its value overrides this with a box that holds every value, so the outline stays still.

UIFocusOutlineBox


protected fromViewSpace(box): UIFocusOutlineBox

Defined in: ui/src/pixi-ui/PixiUIBase.ts:297

Map a rectangle from the widget view’s own space into this element’s.

UIFocusOutlineBox

UIFocusOutlineBox


protected intrinsicSize(): object

Defined in: ui/src/pixi-ui/PixiUIBase.ts:257

The size layout gives this widget when nothing constrains it. A composite that hides or reparents its parts — a dropdown lifting its open list out of this container — overrides this so the space it takes in the flow does not depend on which part is on screen.

object

height: number

width: number


protected invalidateSize(): void

Defined in: ui/src/pixi-ui/PixiUIBase.ts:373

Re-measure on the next layout pass. Yoga caches a measure function’s result, so a prop that changes the widget’s intrinsic size (its text, its item list) leaves the old size in the tree until the node is dirtied.

void


protected optional setPressed(pressed): void

Defined in: ui/src/pixi-ui/PixiUIBase.ts:242

Show the widget’s pressed face while a device holds it down, and its resting face once every device has let go. A widget with no pressed face leaves it out.

true arrives again where the widget has repainted itself under a press that is still held, so an implementation sets the face and never toggles it.

boolean

void


protected sizedByLayout(): boolean

Defined in: ui/src/pixi-ui/PixiUIBase.ts:267

Whether the size layout computes is what makes the widget that size. A composite that places its own parts (a checkbox with a label, a radio group) answers false: sizing its container would scale those parts out of shape, so it draws at its own size inside the layout box.

boolean


abstract update(props): void

Defined in: ui/src/pixi-ui/PixiUIBase.ts:396

Record<string, unknown>

void

UIElementBase.update


protected updateBase(props): void

Defined in: ui/src/pixi-ui/PixiUIBase.ts:378

Apply layout props, visible, and store prevProps. Call at end of subclass update().

Record<string, unknown>

void

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.