Repository navigation
API Class UIView
Defined in: src/plugins/ui/runtime/UIView.ts:59
Base class for everything attached to a node: built-in engine components and user
GameBehaviors (ADR 0007, 0009). Instances are created by the engine
(node.addBehavior(Type) or scene loading), never with new by game code.
new UIView(): UIView;UIView
autoFocus: boolean = false;Defined in: src/plugins/ui/runtime/UIView.ts:75
Focus firstSelected (else the first focusable element) when the view becomes active.
component: string = "";Defined in: src/plugins/ui/runtime/UIView.ts:61
The Svelte component (asset:ui/hud.svelte).
firstSelected: string = "";Defined in: src/plugins/ui/runtime/UIView.ts:81
Where autoFocus, a modal view, and navigate with nothing focused put focus (ADR 0340): the id of an element the
component renders ("options" or "#options"), followed as it re-renders (the element that has the id now, none
once it's gone). Empty: the first focusable element.
matchHeight: number = 1;Defined in: src/plugins/ui/runtime/UIView.ts:67
0: scale with the canvas width; 1: with its height; between: a blend.
modal: boolean = false;Defined in: src/plugins/ui/runtime/UIView.ts:73
While it has a focusable element, focus can't leave it (ADR 0340).
mode: UICanvasMode = "screen";Defined in: src/plugins/ui/runtime/UIView.ts:63
The canvas's settings (as UICanvas's): screen covers the canvas, world is a panel in the scene.
pixelSize: number = 0.01;Defined in: src/plugins/ui/runtime/UIView.ts:71
World mode: world units per UI pixel.
player: number = -1;Defined in: src/plugins/ui/runtime/UIView.ts:83
The local player whose UI actions drive it; -1: any local player.
referenceResolution: Vector2;Defined in: src/plugins/ui/runtime/UIView.ts:65
The UI's design size in UI pixels.
sortOrder: number = 0;Defined in: src/plugins/ui/runtime/UIView.ts:69
Screen canvases draw (and take the pointer) in ascending order: higher is on top. A whole number, as Unity's (ADR 0662): a fraction sorts rounded.
transformError: ((error) => unknown) | null = null;Defined in: src/plugins/ui/runtime/UIView.ts:90
Svelte's transformError (ADR 0423): turns an error a <svelte:boundary> catches into what its failed snippet
and onerror get (a framework's error hook: a message safe to show, an error id). Read when an error is caught,
so setting it takes effect at once; null passes errors through unchanged.
get enabled(): boolean;Defined in: src/engine/core/Component.ts:63
boolean
set enabled(value): void;Defined in: src/engine/core/Component.ts:67
boolean
void
get exports(): Record<string, unknown> | null;Defined in: src/plugins/ui/runtime/UIView.ts:122
The root component's exports while it's mounted (what Svelte's mount returns: its export const and
export function values), or null before it mounts. A remount (re-enabling, hot reload) gives a new object.
Record<string, unknown> | null
get gameObject(): GameObject;Defined in: src/engine/core/Component.ts:43
Unity-style alias for node.
get isActiveAndEnabled(): boolean;Defined in: src/engine/core/Component.ts:74
True when enabled, the node is active in the hierarchy, and the node is in a loaded world.
boolean
get node(): GameObject;Defined in: src/engine/core/Component.ts:38
The node this component is on.
get owner(): GameObject;Defined in: src/engine/core/Component.ts:51
The node this component acts for: the node itself when attached directly, or the parent node when this component lives on a component node (ADR 0009).
get props(): Record<string, unknown>;Defined in: src/plugins/ui/runtime/UIView.ts:107
The component's props. Reactive once mounted: view.props.score = 10 (or a change inside a prop's
object or array) shows in the same frame. Assigning an object replaces every prop.
Record<string, unknown>
set props(value): void;Defined in: src/plugins/ui/runtime/UIView.ts:111
Record<string, unknown>
void
get ready(): Promise<void>;Defined in: src/plugins/ui/runtime/UIView.ts:127
Resolves once the component is mounted (at once if it is).
Promise<void>
get root(): UIViewElement | null;Defined in: src/plugins/ui/runtime/UIView.ts:133
The canvas the component renders into, or null before it's mounted.
UIViewElement | null
get time(): Readonly<TimeState>;Defined in: src/engine/core/Component.ts:99
This component's World's clock (ADR 0032): the same values as Time, but safe to read
outside the World's frame too (after an await, say).
Readonly<TimeState>
get transform(): Transform;Defined in: src/engine/core/Component.ts:57
The Transform of the node this component is on, if it has one.
get world(): WorldHandle;Defined in: src/engine/core/Component.ts:88
A handle on this component's World (ADR 0132): the same one Engine.findWorld returns. Load
a scene into it, pause, connect or destroy it: this.world.loadScene("scenes/level2.scene.json").
Throws for a World no Engine owns.
instantiate(prefabPath, options?): GameObject;Defined in: src/engine/core/Component.ts:109
Instantiate a prefab in this component's World (ADR 0034), like GameObject.instantiate.
Use it in code that may run after an await: by then the frame is over and the current World
is the Engine's default one, which may not be this component's. A parent from another
World throws.
string
InstantiateOptions = {}
query(selector): UIViewElement | null;Defined in: src/plugins/ui/runtime/UIView.ts:143
The first rendered element a selector matches (#play, .row button), or null.
string
UIViewElement | null
queryAll(selector): UIViewElement[];Defined in: src/plugins/ui/runtime/UIView.ts:148
Every rendered element a selector matches, in tree order.
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