Repository navigation
API Interface UIViewElement
Defined in: src/engine/ui/host/hostElement.ts:88
A hosted UI element: a node with one UI component, styled by the cascade.
readonly source: UIHostSource | null;Defined in: src/engine/ui/host/hostElement.ts:142
Where it was written, when the renderer knows (dev builds).
readonly synthetic: boolean;Defined in: src/engine/ui/host/hostElement.ts:144
Made by the renderer, not written: a button's label from its text.
readonly tag: string;Defined in: src/engine/ui/host/hostElement.ts:138
The tag as written (div, button), which selectors match.
readonly tree: UIHostTree;Defined in: src/engine/ui/host/hostElement.ts:136
readonly uiTag: UITag;Defined in: src/engine/ui/host/hostElement.ts:140
The UI element it is.
get attributes(): ReadonlyMap<string, string>;Defined in: src/engine/ui/host/hostElement.ts:172
Its attributes as last set (inline style included).
ReadonlyMap<string, string>
get children(): readonly UIHostElement[];Defined in: src/engine/ui/host/hostElement.ts:159
readonly UIHostElement[]
get classes(): readonly string[];Defined in: src/engine/ui/host/hostElement.ts:167
readonly string[]
get clientHeight(): number;Defined in: src/engine/ui/host/hostElement.ts:382
number
get clientWidth(): number;Defined in: src/engine/ui/host/hostElement.ts:378
number
get component(): UIComponentType;Defined in: src/engine/ui/host/hostElement.ts:151
UIComponentType
get id(): string | null;Defined in: src/engine/ui/host/hostElement.ts:163
string | null
get isValid(): boolean;Defined in: src/engine/ui/host/hostElement.ts:176
boolean
get node(): GameObject;Defined in: src/engine/ui/host/hostElement.ts:147
get parent(): UIHostElement | null;Defined in: src/engine/ui/host/hostElement.ts:155
UIHostElement | null
get scrollHeight(): number;Defined in: src/engine/ui/host/hostElement.ts:374
number
get scrollLeft(): number;Defined in: src/engine/ui/host/hostElement.ts:361
number
set scrollLeft(value): void;Defined in: src/engine/ui/host/hostElement.ts:365
number
void
get scrollTop(): number;Defined in: src/engine/ui/host/hostElement.ts:353
How far its content is scrolled down and right, in UI pixels (scrollY, scrollX); set them to scroll.
number
set scrollTop(value): void;Defined in: src/engine/ui/host/hostElement.ts:357
number
void
get scrollWidth(): number;Defined in: src/engine/ui/host/hostElement.ts:370
Its content's extent and its padding box, from the last layout (UI pixels).
number
get value(): string | null;Defined in: src/engine/ui/host/hostElement.ts:197
Input fields: their text (ADR 0428: any control's value as text, as the DOM's value); null for other elements. Setting it isn't a player change (no events).
string | null
set value(value): void;Defined in: src/engine/ui/host/hostElement.ts:201
string
void
animate(
keyframes,
duration,
hooks
): UIPlayback;Defined in: src/engine/ui/host/hostElement.ts:281
Play keyframes on it (ADR 0423: a Svelte transition's or animate:'s, through the renderer's animate hook) on the
UI animator (ADR 0422 wave 4: the tween backend, on unscaled time): each keyframe is CSS declarations by property
(camel or kebab case), evenly spaced over duration seconds, and the last one's values stay until stop(). Values
convert as a stylesheet's do (its variables included); a declaration it can't animate is warned about once and
left out. hooks.onFrame runs each frame it plays, hooks.onEnd once at its end.
readonly Readonly<Record<string, string>>[]
number
UIPlayHooks
UIPlayback
as<T>(type): T;Defined in: src/engine/ui/host/hostElement.ts:181
Its component as type; throws if it's another kind.
T extends UIComponentType
new (...args) => T
T
blur(): void;Defined in: src/engine/ui/host/hostElement.ts:230
Take its focus away (blur and focusout at once, as the DOM's blur()).
void
bounds():
| {
height: number;
width: number;
x: number;
y: number;
}
| null;Defined in: src/engine/ui/host/hostElement.ts:257
Where it's drawn, in its canvas's UI pixels: its laid-out box through its own and its ancestors' transforms
(ADR 0422 wave 3), as the axis-aligned rectangle around it, not cut down by clips (as the DOM's
getBoundingClientRect). Its box when nothing transforms it; null when it isn't laid out.
| {
height: number;
width: number;
x: number;
y: number;
}
| null
click(): void;Defined in: src/engine/ui/host/hostElement.ts:210
The DOM's click(): a bubbling click dispatched now with HTML's activation (a checkbox toggles before its
handlers and back if one prevents it, a submit button submits its form), whose input, change or submit follow
at once. Nothing on a control that isn't interactable.
void
computedStyle(): Record<string, string>;Defined in: src/engine/ui/host/hostElement.ts:270
Its values as CSS text by camel-case property, as the DOM's getComputedStyle gives them (ADR 0423: what Svelte's
transitions and animate: read through the renderer's measure hook): sizes, edges, transforms and origins in
px from the last layout (layoutNow first for an up-to-date one), the transform as translate() rotate() scale()
(none when it has none), colours as rgba(). Properties UI elements don't have read as their CSS initial value.
Record<string, string>
dispatch(event): void;Defined in: src/engine/ui/host/hostElement.ts:346
Dispatch event (whose element is this element) now through this element's ancestors in the tree, in capture,
target and bubble phases (ADR 0426); one that bubbles out of the canvas unstopped goes on to onUIHostBubbleOut.
void
focus(): void;Defined in: src/engine/ui/host/hostElement.ts:218
Give it focus (buttons, input fields and ADR 0428's controls; an input field starts typing, as a click does). As the
DOM's focus(), the element that had focus gets blur and focusout, then this one focus and focusin, at once.
void
getContext(type): UICanvasContext2D | null;Defined in: src/engine/ui/host/hostElement.ts:238
ADR 0667: a <canvas>'s 2D context, as the DOM's getContext("2d"); null for other elements and other kinds.
"2d"
UICanvasContext2D | null
off(
type,
listener,
options?
): void;Defined in: src/engine/ui/host/hostElement.ts:338
UIHostEventType
UIHostListener
| boolean
| {
capture?: boolean;
}
void
on(
type,
listener,
options?
): void;Defined in: src/engine/ui/host/hostElement.ts:331
Listen to a UI event (click, input, change, submit, focus, blur, pointerenter, pointerleave, and
ADR 0426's pointer, key, focus and drag events, ADR 0427's scroll/scrollend), or to stylesheet animation (ADR
0422 wave 4: transitionend, animationstart, animationiteration, animationend, the frame after they
happened). capture hears it on the way down to its target; once removes the listener once it ran.
UIHostEventType
UIHostListener
| boolean
| {
capture?: boolean;
once?: boolean;
}
void
query(selector): UIHostElement | null;Defined in: src/engine/ui/host/hostElement.ts:187
The first element inside this one a selector matches, or null.
string
UIHostElement | null
queryAll(selector): UIHostElement[];Defined in: src/engine/ui/host/hostElement.ts:192
Every element inside this one a selector matches, in tree order.
string
UIHostElement[]
rect():
| {
height: number;
width: number;
x: number;
y: number;
}
| null;Defined in: src/engine/ui/host/hostElement.ts:243
Its box in its canvas's UI pixels from the UI core's last layout, or null when it isn't laid out (a headless World).
| {
height: number;
width: number;
x: number;
y: number;
}
| null
scrollBy(...args): void;Defined in: src/engine/ui/host/hostElement.ts:392
Scroll its content by dx, dy (or { left, top, behavior }).
...UIScrollToArgs
void
scrollIntoView(options?): void;Defined in: src/engine/ui/host/hostElement.ts:397
Scroll its scrolling ancestors so it shows (block, inline: start, center, end, nearest).
boolean | UIScrollIntoViewOptions
void
scrollTo(...args): void;Defined in: src/engine/ui/host/hostElement.ts:387
Scroll its content to x, y (or { left, top, behavior }).
...UIScrollToArgs
void
toString(): string;Defined in: src/engine/ui/host/hostElement.ts:401
string
This wiki is generated from docs/wiki/ and the myco module's source on every push to master. Change pages there in a pull request: edits made here are not kept.
Basics
Gameplay
Rendering
Audio
- Playing sound
- Why is there no sound?
- Playlists
- Interactive music
- Sound generators
- Spatial audio
- Audio mixer
- Live mixing
- Loudness
- Audio profiler
- Audio takes
Reference