Skip to content

UIElementBase

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

The base class of every @yagejs/ui element. It holds the element’s transformOrigin, scale, rotation and zIndex, and its parent’s layout pass places it about its transformOrigin. A custom element extends it and calls applyTransformProps from its constructor and its update().

new UIElementBase(): UIElementBase

UIElementBase

readonly _transform: ElementTransform

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

Internal

UIElement._transform


abstract readonly displayObject: DisplayContainer

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

UIElement.displayObject


abstract visible: boolean

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

UIElement.visible


abstract readonly yogaNode: Node

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

UIElement.yogaNode

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


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


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


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

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


abstract destroy(): void

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

void

UIElement.destroy


abstract update(props): void

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

Record<string, unknown>

void

UIElement.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.