Repository navigation
API Class UIText
Defined in: src/engine/ui/components.ts:443
Text laid out as an element. Its font is the bundled Inter (weights 100–900; Latin, Latin-1 and
common punctuation, other characters falling back to the system font), or the project font file
font names.
UIElement
new UIText(): UIText;UIText
UIElement.constructor
alignContent: UIAlignContent = "stretch";Defined in: src/engine/ui/components.ts:230
How wrapped lines share the space across the direction (only with flexWrap).
UIElement.alignContent
alignItems: UIAlign = "stretch";Defined in: src/engine/ui/components.ts:148
UIElement.alignItems
alignSelf: UIAlignSelf = "auto";Defined in: src/engine/ui/components.ts:228
This element's alignment across its parent's direction; auto takes the parent's alignItems.
UIElement.alignSelf
aspectRatio: number = 0;Defined in: src/engine/ui/components.ts:239
Width divided by height, kept when only one of them is set (aspect-ratio: 16 / 9); 0: none.
UIElement.aspectRatio
backdropBlur: number = 0;Defined in: src/engine/ui/components.ts:377
UIElement.backdropBlur
backdropBrightness: number = 1;Defined in: src/engine/ui/components.ts:378
UIElement.backdropBrightness
backdropContrast: number = 1;Defined in: src/engine/ui/components.ts:379
UIElement.backdropContrast
backdropDropShadowBlur: number = 0;Defined in: src/engine/ui/components.ts:389
UIElement.backdropDropShadowBlur
backdropDropShadowColor: Color | null = null;Defined in: src/engine/ui/components.ts:386
UIElement.backdropDropShadowColor
backdropDropShadowOffsetX: number = 0;Defined in: src/engine/ui/components.ts:387
UIElement.backdropDropShadowOffsetX
backdropDropShadowOffsetY: number = 0;Defined in: src/engine/ui/components.ts:388
UIElement.backdropDropShadowOffsetY
backdropGrayscale: number = 0;Defined in: src/engine/ui/components.ts:380
UIElement.backdropGrayscale
backdropHueRotate: number = 0;Defined in: src/engine/ui/components.ts:381
UIElement.backdropHueRotate
backdropInvert: number = 0;Defined in: src/engine/ui/components.ts:382
UIElement.backdropInvert
backdropOpacity: number = 1;Defined in: src/engine/ui/components.ts:383
UIElement.backdropOpacity
backdropSaturate: number = 1;Defined in: src/engine/ui/components.ts:384
UIElement.backdropSaturate
backdropSepia: number = 0;Defined in: src/engine/ui/components.ts:385
UIElement.backdropSepia
backgroundColor: Color | null = null;Defined in: src/engine/ui/components.ts:483
Painted behind the text: an inline run's glyphs (and its inline children's), or the whole box of a text element; null paints nothing.
borderBottomWidth: number | null = null;Defined in: src/engine/ui/components.ts:509
borderColor: Color = Color.black;Defined in: src/engine/ui/components.ts:511
borderLeftWidth: number | null = null;Defined in: src/engine/ui/components.ts:510
borderRadius: number = 0;Defined in: src/engine/ui/components.ts:513
Rounds the corners of its border and background, in UI pixels (border-radius with one value).
borderRightWidth: number | null = null;Defined in: src/engine/ui/components.ts:508
borderTopWidth: number | null = null;Defined in: src/engine/ui/components.ts:507
The border's width on one side (border-top-width …). Null (the default): borderWidth.
borderWidth: number = 0;Defined in: src/engine/ui/components.ts:505
A border on every side, in UI pixels (border-width; border takes a width, solid or none, and a colour). It
lays out and draws around a text's box; on an inline run, around its part of each line (its start and end sides
only where the run starts and ends, as CSS slices an inline box), taking room on the line only at those sides.
bottom: UILength = "auto";Defined in: src/engine/ui/components.ts:162
UIElement.bottom
color: Color = Color.white;Defined in: src/engine/ui/components.ts:451
contentEditable: boolean = false;Defined in: src/engine/ui/components.ts:485
contenteditable: the player edits the text (a press puts the caret, typing and the IME go through the hidden input, input events follow); whitespace is kept as typed.
direction: UIDirection | null = null;Defined in: src/engine/ui/components.ts:306
ADR 0432: its direction (CSS direction, HTML dir); null (the default) takes its parent's, and a canvas is ltr.
In rtl a row lays out from the right and a scroller's horizontal scrolling starts at the right: scrollX is 0
there and negative toward the left, as browsers' scrollLeft. A text's base direction (its runs' order, start/end alignment) is its own or an ancestor's direction when one is set, else the language's.
UIElement.direction
display: UIDisplay = "flex";Defined in: src/engine/ui/components.ts:175
none removes the element and its children from layout, drawing and the pointer, like CSS
display: none, while its node stays active (its scripts run, and its state reads as before).
flex (the default) lays it out.
UIElement.display
draggable: boolean = false;Defined in: src/engine/ui/components.ts:312
ADR 0426: a pointer press on it (or inside it) that moves starts a UI drag: dragstart on it, drag while it
moves, dragenter/dragover/dragleave on the elements under the pointer, drop where it's released (if a
dragover there was prevented), then dragend. HTML's draggable attribute.
UIElement.draggable
filterBlur: number = 0;Defined in: src/engine/ui/components.ts:350
blur(): a Gaussian blur, its standard deviation in UI pixels. 0: none.
UIElement.filterBlur
filterBrightness: number = 1;Defined in: src/engine/ui/components.ts:352
brightness(): 1 as it is, 0 black, above 1 brighter.
UIElement.filterBrightness
filterContrast: number = 1;Defined in: src/engine/ui/components.ts:354
contrast(): 1 as it is, 0 flat grey.
UIElement.filterContrast
filterDropShadowBlur: number = 0;Defined in: src/engine/ui/components.ts:372
UIElement.filterDropShadowBlur
filterDropShadowColor: Color | null = null;Defined in: src/engine/ui/components.ts:368
drop-shadow()'s colour: a shadow of what's drawn (its shape, not its box). Null: none.
UIElement.filterDropShadowColor
filterDropShadowOffsetX: number = 0;Defined in: src/engine/ui/components.ts:370
The drop shadow's offset right and down, and its blur, in UI pixels.
UIElement.filterDropShadowOffsetX
filterDropShadowOffsetY: number = 0;Defined in: src/engine/ui/components.ts:371
UIElement.filterDropShadowOffsetY
filterGrayscale: number = 0;Defined in: src/engine/ui/components.ts:356
grayscale(): 0 as it is, 1 fully grey.
UIElement.filterGrayscale
filterHueRotate: number = 0;Defined in: src/engine/ui/components.ts:358
hue-rotate(), in degrees.
UIElement.filterHueRotate
filterInvert: number = 0;Defined in: src/engine/ui/components.ts:360
invert(): 0 as it is, 1 inverted.
UIElement.filterInvert
filterOpacity: number = 1;Defined in: src/engine/ui/components.ts:362
opacity(): like opacity, applied as a filter step (after the ones before it). 1 as it is.
UIElement.filterOpacity
filterSaturate: number = 1;Defined in: src/engine/ui/components.ts:364
saturate(): 1 as it is, 0 grey, above 1 more saturated.
UIElement.filterSaturate
filterSepia: number = 0;Defined in: src/engine/ui/components.ts:366
sepia(): 0 as it is, 1 fully sepia.
UIElement.filterSepia
flexBasis: UILength = "auto";Defined in: src/engine/ui/components.ts:237
Its size along the parent's direction before growing and shrinking: pixels, a percentage, or "auto" (its width/height).
UIElement.flexBasis
flexDirection: UIFlexDirection = "row";Defined in: src/engine/ui/components.ts:146
How this element lays out its children.
UIElement.flexDirection
flexGrow: number = 0;Defined in: src/engine/ui/components.ts:165
How much of the parent's free space this element takes, relative to its siblings.
UIElement.flexGrow
flexShrink: number | null = null;Defined in: src/engine/ui/components.ts:235
How much this element shrinks, relative to its siblings, when they don't fit. Null (the default): its kind's, as before: text shrinks (and wraps to what's left), other elements keep their size.
UIElement.flexShrink
flexWrap: UIFlexWrap = "nowrap";Defined in: src/engine/ui/components.ts:226
Whether children that don't fit on one line wrap onto more (wrap-reverse: new lines go before the first).
UIElement.flexWrap
font: string = "";Defined in: src/engine/ui/components.ts:449
A font file in the project (asset:fonts/Pirata.ttf; .ttf, .otf, .woff or .woff2), loaded
the first time it's used; empty is the bundled Inter. Characters the font lacks use Inter.
fontSize: number = 16;Defined in: src/engine/ui/components.ts:450
fontStyle: UIFontStyle = "normal";Defined in: src/engine/ui/components.ts:479
italic (or oblique, drawn italic) slants the glyphs (font-style, inherited).
fontWeight: string = "normal";Defined in: src/engine/ui/components.ts:453
"light" (300), "normal" (400), "medium" (500), "semi-bold" (600), "bold" (700), or a whole number 1–1000 (anything else is 400).
gap: number = 0;Defined in: src/engine/ui/components.ts:150
Space between children.
UIElement.gap
height: UILength = "auto";Defined in: src/engine/ui/components.ts:157
UIElement.height
inert: boolean = false;Defined in: src/engine/ui/components.ts:203
HTML's inert: the element and everything inside it are drawn as before but take no part in interaction: the
pointer passes through them (to what's behind), and they can't take focus or be navigated to (focus inside leaves).
Svelte's outros set it on outroing elements.
UIElement.inert
justifyContent: UIJustify = "flex-start";Defined in: src/engine/ui/components.ts:147
UIElement.justifyContent
left: UILength = "auto";Defined in: src/engine/ui/components.ts:163
UIElement.left
margin: number = 0;Defined in: src/engine/ui/components.ts:154
Space around the element, on every side.
UIElement.margin
marginBottom: number | null = null;Defined in: src/engine/ui/components.ts:217
UIElement.marginBottom
marginLeft: number | null = null;Defined in: src/engine/ui/components.ts:218
UIElement.marginLeft
marginRight: number | null = null;Defined in: src/engine/ui/components.ts:216
UIElement.marginRight
marginTop: number | null = null;Defined in: src/engine/ui/components.ts:215
Space around the element on one side (margin-top …; the margin shorthand takes one to four values). Null: margin.
UIElement.marginTop
maxHeight: UILength = "none";Defined in: src/engine/ui/components.ts:224
UIElement.maxHeight
maxWidth: UILength = "none";Defined in: src/engine/ui/components.ts:223
The largest size layout gives it: pixels, a percentage of the parent, or "none" (no maximum).
UIElement.maxWidth
minHeight: UILength = "auto";Defined in: src/engine/ui/components.ts:221
UIElement.minHeight
minWidth: UILength = "auto";Defined in: src/engine/ui/components.ts:220
The smallest size layout gives it: pixels, a percentage of the parent, or "auto" (no minimum).
UIElement.minWidth
opacity: number = 1;Defined in: src/engine/ui/components.ts:167
0..1, multiplied into its children's.
UIElement.opacity
overflow: UIOverflow = "visible";Defined in: src/engine/ui/components.ts:247
hidden clips its children to its padding box (inside its border): they are drawn and take the pointer only
there. It also draws them together, at its own place in the order (as an element with a zIndex does).
auto and scroll clip them the same way and scroll them (ADR 0427): by the wheel, a touch or pen drag, the
keyboard, a draggable scrollbar, navigation and scrollX/scrollY. The stylesheet's overflow: x y sets the
two axes (overflowX, overflowY).
UIElement.overflow
overflowX: UIOverflow | null = null;Defined in: src/engine/ui/components.ts:249
ADR 0427: the horizontal axis's overflow (overflow-x); null (the default) takes overflow.
UIElement.overflowX
overflowY: UIOverflow | null = null;Defined in: src/engine/ui/components.ts:251
ADR 0427: the vertical axis's overflow (overflow-y); null takes overflow.
UIElement.overflowY
overscrollBehavior: UIOverscrollBehavior = "auto";Defined in: src/engine/ui/components.ts:264
ADR 0427: contain or none: once it can't scroll further, the wheel and drags don't go on to scroll its ancestors.
UIElement.overscrollBehavior
padding: number = 0;Defined in: src/engine/ui/components.ts:152
Space inside the element, on every side.
UIElement.padding
paddingBottom: number | null = null;Defined in: src/engine/ui/components.ts:212
UIElement.paddingBottom
paddingLeft: number | null = null;Defined in: src/engine/ui/components.ts:213
UIElement.paddingLeft
paddingRight: number | null = null;Defined in: src/engine/ui/components.ts:211
UIElement.paddingRight
paddingTop: number | null = null;Defined in: src/engine/ui/components.ts:210
Space inside the element on one side (padding-top …; the padding shorthand takes one to four values, as in
CSS). Null (the default): padding, the all-sides value.
UIElement.paddingTop
positionType: UIPositionType = "relative";Defined in: src/engine/ui/components.ts:159
absolute takes the element out of its parent's flow, placed by top/right/bottom/left.
UIElement.positionType
raycastTarget: boolean = true;Defined in: src/engine/ui/components.ts:190
Whether the pointer stops at this element, like Unity's Graphic.raycastTarget (ADR 0385). True (the default):
a press over it goes to the UI, never to the game (Input.pointerOverUI is true), and reaches the button or
input field it's in, if any; over text, an image or a panel outside one, it does nothing. False: the pointer
passes through to whatever is behind it (other UI, or the game). Text, images, buttons and input fields stop
it; a panel only when it draws a background (even a transparent one) or a border, as a panel without either is
a layout box (Unity's empty RectTransform). Children aren't affected: each element has its own.
UIElement.raycastTarget
right: UILength = "auto";Defined in: src/engine/ui/components.ts:161
UIElement.right
rotate: number = 0;Defined in: src/engine/ui/components.ts:333
How far it's drawn turned clockwise about its transform origin, in degrees (rotate: 45deg, 0.25turn, 1rad).
UIElement.rotate
scaleX: number = 1;Defined in: src/engine/ui/components.ts:330
How much it's drawn stretched across (scale: 2 sets both; scale: 2 1 each), about its transform origin. 1: as laid out.
UIElement.scaleX
scaleY: number = 1;Defined in: src/engine/ui/components.ts:331
UIElement.scaleY
scrollbarGutter: UIScrollbarGutter = "auto";Defined in: src/engine/ui/components.ts:276
ADR 0432: whether the vertical scrollbar's space is kept (scrollbar-gutter): auto draws the bar over the content;
stable (on an element that clips) reserves it beside the padding box, on the bar's side, whether or not the bar
shows, so clientWidth is smaller and the content doesn't move when it appears; stable both-edges on both sides.
UIElement.scrollbarGutter
scrollbarThumbColor: Color | null = null;Defined in: src/engine/ui/components.ts:268
ADR 0427: its scrollbars' thumb colour (scrollbar-color: thumb track); null: the default, a light grey.
UIElement.scrollbarThumbColor
scrollbarTrackColor: Color | null = null;Defined in: src/engine/ui/components.ts:270
ADR 0427: its scrollbars' track colour; null: the default, a faint dark strip.
UIElement.scrollbarTrackColor
scrollbarWidth: UIScrollbarWidth = "auto";Defined in: src/engine/ui/components.ts:266
ADR 0427: its scrollbars' thickness (scrollbar-width): auto, thin or none.
UIElement.scrollbarWidth
scrollBehavior: UIScrollBehavior = "auto";Defined in: src/engine/ui/components.ts:262
ADR 0427: smooth animates scripted scrolling (scrollTo, scrollBy, scrollIntoView and navigation's); auto jumps.
UIElement.scrollBehavior
scrollMarginBottom: number = 0;Defined in: src/engine/ui/components.ts:299
UIElement.scrollMarginBottom
scrollMarginLeft: number = 0;Defined in: src/engine/ui/components.ts:300
UIElement.scrollMarginLeft
scrollMarginRight: number = 0;Defined in: src/engine/ui/components.ts:298
UIElement.scrollMarginRight
scrollMarginTop: number = 0;Defined in: src/engine/ui/components.ts:297
ADR 0432: this element's snap area outset from its border box (scroll-margin), UI pixels per side.
UIElement.scrollMarginTop
scrollPaddingBottom: number = 0;Defined in: src/engine/ui/components.ts:294
UIElement.scrollPaddingBottom
scrollPaddingLeft: number = 0;Defined in: src/engine/ui/components.ts:295
UIElement.scrollPaddingLeft
scrollPaddingRight: number = 0;Defined in: src/engine/ui/components.ts:293
UIElement.scrollPaddingRight
scrollPaddingTop: number = 0;Defined in: src/engine/ui/components.ts:292
ADR 0432: a scroller's snapport inset from its padding box (scroll-padding), UI pixels per side.
UIElement.scrollPaddingTop
scrollSnapAlignBlock: UIScrollSnapAlign = "none";Defined in: src/engine/ui/components.ts:286
ADR 0432: how this element lines up in its scroller when snapped, vertically (scroll-snap-align's first value).
UIElement.scrollSnapAlignBlock
scrollSnapAlignInline: UIScrollSnapAlign = "none";Defined in: src/engine/ui/components.ts:288
ADR 0432: …and horizontally (scroll-snap-align's second value; one value sets both).
UIElement.scrollSnapAlignInline
scrollSnapAxis: UIScrollSnapAxis = "none";Defined in: src/engine/ui/components.ts:282
ADR 0432: CSS Scroll Snap on a scroller (scroll-snap-type: <axis> [mandatory | proximity]): the axes it snaps
on. After the wheel settles, a touch drag's momentum, keys, scrollTo/scrollBy, scrollIntoView and
navigation, it rests where a descendant's scroll-snap-align says; after a layout change it snaps again.
UIElement.scrollSnapAxis
scrollSnapStop: UIScrollSnapStop = "normal";Defined in: src/engine/ui/components.ts:290
ADR 0432: always: a scroll gesture stops at this element's snap position rather than passing over it.
UIElement.scrollSnapStop
scrollSnapStrictness: UIScrollSnapStrictness = "proximity";Defined in: src/engine/ui/components.ts:284
ADR 0432: mandatory always rests on a snap position; proximity (the default) only near one.
UIElement.scrollSnapStrictness
scrollX: number = 0;Defined in: src/engine/ui/components.ts:259
ADR 0427: how far its content is scrolled right and down, in UI pixels (scrollLeft/scrollTop on the web).
Scripts write them; the UI core keeps them between 0 and how far the content reaches past its padding box, at
each layout. Only an element that clips (overflow other than visible) scrolls. ADR 0432: an axis whose content
starts at its far end (row-reverse, column-reverse, direction: rtl) is 0 showing that end and negative
toward the other, as CSSOM's offsets are.
UIElement.scrollX
scrollY: number = 0;Defined in: src/engine/ui/components.ts:260
UIElement.scrollY
selectionBackgroundColor: Color | null = null;Defined in: src/engine/ui/components.ts:489
ADR 0432: painted behind an editable text's selection (::selection's background-color); null: the default highlight.
selectionColor: Color | null = null;Defined in: src/engine/ui/components.ts:487
ADR 0432: an editable text's selected glyphs (::selection's color); null keeps their own colour.
text: string = "";Defined in: src/engine/ui/components.ts:444
textAlign: UITextAlign = "start";Defined in: src/engine/ui/components.ts:455
start (the default) and end follow the language's direction: start is left in English, right in Arabic.
textDecoration: string = "none";Defined in: src/engine/ui/components.ts:481
Lines drawn with the glyphs (text-decoration): none, or any of underline, line-through and overline, space-separated. A run's reach its inline children.
textOutlineColor: Color | null = null;Defined in: src/engine/ui/components.ts:462
The colour of an outline drawn around the glyphs (ADR 0421; text-outline-color in a stylesheet, inherited like
color); null draws none. It shows only with a textOutlineWidth above 0.
textOutlineWidth: number = 0;Defined in: src/engine/ui/components.ts:464
How far the outline reaches outside the glyphs, in UI pixels (text-outline-width, inherited); 0 draws none. It doesn't change the layout.
textShadowBlur: number = 0;Defined in: src/engine/ui/components.ts:474
How far the text shadow blurs, in UI pixels (text-shadow-blur, inherited).
textShadowColor: Color | null = null;Defined in: src/engine/ui/components.ts:468
A shadow under the glyphs (text-shadow: offset-x offset-y blur colour, inherited); null draws none.
textShadowOffsetX: number = 0;Defined in: src/engine/ui/components.ts:470
The text shadow's offset to the right, in UI pixels (text-shadow-offset-x, inherited).
textShadowOffsetY: number = 0;Defined in: src/engine/ui/components.ts:472
The text shadow's offset down, in UI pixels (text-shadow-offset-y, inherited).
textWrapMode: UITextWrapMode = "wrap";Defined in: src/engine/ui/components.ts:499
Whether lines wrap at the text's width (text-wrap-mode, inherited); nowrap keeps them whole, so only line breaks break them.
top: UILength = "auto";Defined in: src/engine/ui/components.ts:160
UIElement.top
transformMatrix: string = "";Defined in: src/engine/ui/components.ts:345
ADR 0430: a full 2D matrix applied after translate, rotate and scale, as matrix(a, b, c, d, e, f) (pixels); "" (the
default) for none. A stylesheet's transform list that doesn't fold into the three (one with skew(), skewX(),
skewY() or matrix(), or a rotation after an unequal scale) sets it. It animates as CSS interpolates matrices.
UIElement.transformMatrix
transformOriginX: UILength = "50%";Defined in: src/engine/ui/components.ts:338
The point it turns and scales about, across its own box: pixels from its left edge, or a percentage of its width
(transform-origin: left top, 25% 75%, 10px 4px). Default: the middle.
UIElement.transformOriginX
transformOriginY: UILength = "50%";Defined in: src/engine/ui/components.ts:339
UIElement.transformOriginY
translateX: UILength = "0";Defined in: src/engine/ui/components.ts:326
How far the element is drawn moved right: pixels, or a percentage of its own width ("50%"). A stylesheet's
translate: x y or transform: translate(x, y) sets it with translateY. (The translate attribute stays
HTML's localisation marker: in markup write transform="translate(…)" or translate-x.)
UIElement.translateX
translateY: UILength = "0";Defined in: src/engine/ui/components.ts:328
How far it's drawn moved down: pixels, or a percentage of its own height.
UIElement.translateY
verticalAlign: UIVerticalAlign = "baseline";Defined in: src/engine/ui/components.ts:181
Its place on a text's line (vertical-align), as an inline run or (ADR 0432) an atomic inline box: sub and super
lower and raise its baseline; middle, top, bottom, text-top, text-bottom align its box. Outside a text it
does nothing.
UIElement.verticalAlign
visible: boolean = true;Defined in: src/engine/ui/components.ts:169
False hides the element and its children but keeps its space (a disabled component or inactive node takes none).
UIElement.visible
whiteSpaceCollapse: UIWhiteSpaceCollapse = "collapse";Defined in: src/engine/ui/components.ts:497
How spaces and line breaks show (white-space-collapse, inherited; a stylesheet's white-space sets it with textWrapMode). An editable text keeps them as typed.
width: UILength = "auto";Defined in: src/engine/ui/components.ts:156
Pixels (120), a percentage of the parent ("50%") or "auto" (sized by its content).
UIElement.width
willChange: string = "auto";Defined in: src/engine/ui/components.ts:197
CSS will-change (ADR 0666): anything but auto draws the element and its descendants in their own layer, a texture
drawn as a quad, so a change inside it redraws only that texture and moving it redraws nothing. For what moves or
changes often (a marker, a minimap, a clock); everything else is cheapest left in the canvas's base texture. Values
as in CSS (transform, contents, opacity, a comma list); not inherited.
UIElement.willChange
wordBreak: UIWordBreak = "break-word";Defined in: src/engine/ui/components.ts:457
How lines wrap: at word boundaries, anywhere, or never.
zIndex: number = 0;Defined in: src/engine/ui/components.ts:317
Draw and pointer order among its siblings (higher on top, then document order), as in CSS. A non-zero value draws the element and its children together, ordered within it.
UIElement.zIndex
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
UIElement.enabled
get gameObject(): GameObject;Defined in: src/engine/core/Component.ts:43
Unity-style alias for node.
UIElement.gameObject
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
UIElement.isActiveAndEnabled
get node(): GameObject;Defined in: src/engine/core/Component.ts:38
The node this component is on.
UIElement.node
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).
UIElement.owner
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>
UIElement.time
get transform(): Transform;Defined in: src/engine/core/Component.ts:57
The Transform of the node this component is on, if it has one.
UIElement.transform
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.
UIElement.world
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 = {}
UIElement.instantiate
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