Skip to content

API Class UIVideo

github-actions[bot] edited this page Dec 2, 2026 · 8 revisions

Class: UIVideo

Defined in: src/engine/ui/components.ts:567

ADR 0430: a video (<video> in Svelte UI): an image whose picture is a video's current frame, drawn each frame while it plays. Its source is an HTMLVideoElement made from src in a browser, or any media element a script hands to media (a stream, or one it made). play(), pause(), currentTime, duration, paused and ended are the media element's; loop, muted, volume and playbackRate are fields kept on it each frame. on("ended", …) and the other media events come from it.

Extends

Implements

  • UIMediaElement
  • UIMediaFields

Constructors

Constructor

new UIVideo(): UIVideo;

Returns

UIVideo

Inherited from

UIImage.constructor

Properties

alignContent

alignContent: UIAlignContent = "stretch";

Defined in: src/engine/ui/components.ts:230

How wrapped lines share the space across the direction (only with flexWrap).

Inherited from

UIImage.alignContent


alignItems

alignItems: UIAlign = "stretch";

Defined in: src/engine/ui/components.ts:148

Inherited from

UIImage.alignItems


alignSelf

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.

Inherited from

UIImage.alignSelf


aspectRatio

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.

Inherited from

UIImage.aspectRatio


autoplay

autoplay: boolean = false;

Defined in: src/engine/ui/components.ts:571

Start playing once it's shown (browsers allow only muted video to start without a gesture).

Implementation of

UIMediaFields.autoplay


backdropBlur

backdropBlur: number = 0;

Defined in: src/engine/ui/components.ts:377

Inherited from

UIImage.backdropBlur


backdropBrightness

backdropBrightness: number = 1;

Defined in: src/engine/ui/components.ts:378

Inherited from

UIImage.backdropBrightness


backdropContrast

backdropContrast: number = 1;

Defined in: src/engine/ui/components.ts:379

Inherited from

UIImage.backdropContrast


backdropDropShadowBlur

backdropDropShadowBlur: number = 0;

Defined in: src/engine/ui/components.ts:389

Inherited from

UIImage.backdropDropShadowBlur


backdropDropShadowColor

backdropDropShadowColor: Color | null = null;

Defined in: src/engine/ui/components.ts:386

Inherited from

UIImage.backdropDropShadowColor


backdropDropShadowOffsetX

backdropDropShadowOffsetX: number = 0;

Defined in: src/engine/ui/components.ts:387

Inherited from

UIImage.backdropDropShadowOffsetX


backdropDropShadowOffsetY

backdropDropShadowOffsetY: number = 0;

Defined in: src/engine/ui/components.ts:388

Inherited from

UIImage.backdropDropShadowOffsetY


backdropGrayscale

backdropGrayscale: number = 0;

Defined in: src/engine/ui/components.ts:380

Inherited from

UIImage.backdropGrayscale


backdropHueRotate

backdropHueRotate: number = 0;

Defined in: src/engine/ui/components.ts:381

Inherited from

UIImage.backdropHueRotate


backdropInvert

backdropInvert: number = 0;

Defined in: src/engine/ui/components.ts:382

Inherited from

UIImage.backdropInvert


backdropOpacity

backdropOpacity: number = 1;

Defined in: src/engine/ui/components.ts:383

Inherited from

UIImage.backdropOpacity


backdropSaturate

backdropSaturate: number = 1;

Defined in: src/engine/ui/components.ts:384

Inherited from

UIImage.backdropSaturate


backdropSepia

backdropSepia: number = 0;

Defined in: src/engine/ui/components.ts:385

Inherited from

UIImage.backdropSepia


bottom

bottom: UILength = "auto";

Defined in: src/engine/ui/components.ts:162

Inherited from

UIImage.bottom


direction

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.

Inherited from

UIImage.direction


display

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.

Inherited from

UIImage.display


draggable

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.

Inherited from

UIImage.draggable


filterBlur

filterBlur: number = 0;

Defined in: src/engine/ui/components.ts:350

blur(): a Gaussian blur, its standard deviation in UI pixels. 0: none.

Inherited from

UIImage.filterBlur


filterBrightness

filterBrightness: number = 1;

Defined in: src/engine/ui/components.ts:352

brightness(): 1 as it is, 0 black, above 1 brighter.

Inherited from

UIImage.filterBrightness


filterContrast

filterContrast: number = 1;

Defined in: src/engine/ui/components.ts:354

contrast(): 1 as it is, 0 flat grey.

Inherited from

UIImage.filterContrast


filterDropShadowBlur

filterDropShadowBlur: number = 0;

Defined in: src/engine/ui/components.ts:372

Inherited from

UIImage.filterDropShadowBlur


filterDropShadowColor

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.

Inherited from

UIImage.filterDropShadowColor


filterDropShadowOffsetX

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.

Inherited from

UIImage.filterDropShadowOffsetX


filterDropShadowOffsetY

filterDropShadowOffsetY: number = 0;

Defined in: src/engine/ui/components.ts:371

Inherited from

UIImage.filterDropShadowOffsetY


filterGrayscale

filterGrayscale: number = 0;

Defined in: src/engine/ui/components.ts:356

grayscale(): 0 as it is, 1 fully grey.

Inherited from

UIImage.filterGrayscale


filterHueRotate

filterHueRotate: number = 0;

Defined in: src/engine/ui/components.ts:358

hue-rotate(), in degrees.

Inherited from

UIImage.filterHueRotate


filterInvert

filterInvert: number = 0;

Defined in: src/engine/ui/components.ts:360

invert(): 0 as it is, 1 inverted.

Inherited from

UIImage.filterInvert


filterOpacity

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.

Inherited from

UIImage.filterOpacity


filterSaturate

filterSaturate: number = 1;

Defined in: src/engine/ui/components.ts:364

saturate(): 1 as it is, 0 grey, above 1 more saturated.

Inherited from

UIImage.filterSaturate


filterSepia

filterSepia: number = 0;

Defined in: src/engine/ui/components.ts:366

sepia(): 0 as it is, 1 fully sepia.

Inherited from

UIImage.filterSepia


fit

fit: UIImageFit = "fill";

Defined in: src/engine/ui/components.ts:527

fill stretches it to the element; cover fills the element and crops; contain keeps the texture's aspect ratio when the element's size comes from it (one side auto).

Inherited from

UIImage.fit


flexBasis

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

Inherited from

UIImage.flexBasis


flexDirection

flexDirection: UIFlexDirection = "row";

Defined in: src/engine/ui/components.ts:146

How this element lays out its children.

Inherited from

UIImage.flexDirection


flexGrow

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.

Inherited from

UIImage.flexGrow


flexShrink

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.

Inherited from

UIImage.flexShrink


flexWrap

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

Inherited from

UIImage.flexWrap


gap

gap: number = 0;

Defined in: src/engine/ui/components.ts:150

Space between children.

Inherited from

UIImage.gap


height

height: UILength = "auto";

Defined in: src/engine/ui/components.ts:157

Inherited from

UIImage.height


image

image: string = "";

Defined in: src/engine/ui/components.ts:522

Texture asset (asset:images/logo.png).

Inherited from

UIImage.image


inert

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.

Inherited from

UIImage.inert


justifyContent

justifyContent: UIJustify = "flex-start";

Defined in: src/engine/ui/components.ts:147

Inherited from

UIImage.justifyContent


left

left: UILength = "auto";

Defined in: src/engine/ui/components.ts:163

Inherited from

UIImage.left


loop

loop: boolean = false;

Defined in: src/engine/ui/components.ts:572

Implementation of

UIMediaFields.loop


margin

margin: number = 0;

Defined in: src/engine/ui/components.ts:154

Space around the element, on every side.

Inherited from

UIImage.margin


marginBottom

marginBottom: number | null = null;

Defined in: src/engine/ui/components.ts:217

Inherited from

UIImage.marginBottom


marginLeft

marginLeft: number | null = null;

Defined in: src/engine/ui/components.ts:218

Inherited from

UIImage.marginLeft


marginRight

marginRight: number | null = null;

Defined in: src/engine/ui/components.ts:216

Inherited from

UIImage.marginRight


marginTop

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.

Inherited from

UIImage.marginTop


maxHeight

maxHeight: UILength = "none";

Defined in: src/engine/ui/components.ts:224

Inherited from

UIImage.maxHeight


maxWidth

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

Inherited from

UIImage.maxWidth


minHeight

minHeight: UILength = "auto";

Defined in: src/engine/ui/components.ts:221

Inherited from

UIImage.minHeight


minWidth

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

Inherited from

UIImage.minWidth


muted

muted: boolean = false;

Defined in: src/engine/ui/components.ts:573

Implementation of

UIMediaFields.muted


opacity

opacity: number = 1;

Defined in: src/engine/ui/components.ts:167

0..1, multiplied into its children's.

Inherited from

UIImage.opacity


overflow

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

Inherited from

UIImage.overflow


overflowX

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.

Inherited from

UIImage.overflowX


overflowY

overflowY: UIOverflow | null = null;

Defined in: src/engine/ui/components.ts:251

ADR 0427: the vertical axis's overflow (overflow-y); null takes overflow.

Inherited from

UIImage.overflowY


overscrollBehavior

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.

Inherited from

UIImage.overscrollBehavior


padding

padding: number = 0;

Defined in: src/engine/ui/components.ts:152

Space inside the element, on every side.

Inherited from

UIImage.padding


paddingBottom

paddingBottom: number | null = null;

Defined in: src/engine/ui/components.ts:212

Inherited from

UIImage.paddingBottom


paddingLeft

paddingLeft: number | null = null;

Defined in: src/engine/ui/components.ts:213

Inherited from

UIImage.paddingLeft


paddingRight

paddingRight: number | null = null;

Defined in: src/engine/ui/components.ts:211

Inherited from

UIImage.paddingRight


paddingTop

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.

Inherited from

UIImage.paddingTop


playbackRate

playbackRate: number = 1;

Defined in: src/engine/ui/components.ts:577

1: normal speed.

Implementation of

UIMediaFields.playbackRate


positionType

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.

Inherited from

UIImage.positionType


raycastTarget

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.

Inherited from

UIImage.raycastTarget


right

right: UILength = "auto";

Defined in: src/engine/ui/components.ts:161

Inherited from

UIImage.right


rotate

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

Inherited from

UIImage.rotate


scaleX

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.

Inherited from

UIImage.scaleX


scaleY

scaleY: number = 1;

Defined in: src/engine/ui/components.ts:331

Inherited from

UIImage.scaleY


scrollbarGutter

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.

Inherited from

UIImage.scrollbarGutter


scrollbarThumbColor

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.

Inherited from

UIImage.scrollbarThumbColor


scrollbarTrackColor

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.

Inherited from

UIImage.scrollbarTrackColor


scrollbarWidth

scrollbarWidth: UIScrollbarWidth = "auto";

Defined in: src/engine/ui/components.ts:266

ADR 0427: its scrollbars' thickness (scrollbar-width): auto, thin or none.

Inherited from

UIImage.scrollbarWidth


scrollBehavior

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.

Inherited from

UIImage.scrollBehavior


scrollMarginBottom

scrollMarginBottom: number = 0;

Defined in: src/engine/ui/components.ts:299

Inherited from

UIImage.scrollMarginBottom


scrollMarginLeft

scrollMarginLeft: number = 0;

Defined in: src/engine/ui/components.ts:300

Inherited from

UIImage.scrollMarginLeft


scrollMarginRight

scrollMarginRight: number = 0;

Defined in: src/engine/ui/components.ts:298

Inherited from

UIImage.scrollMarginRight


scrollMarginTop

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.

Inherited from

UIImage.scrollMarginTop


scrollPaddingBottom

scrollPaddingBottom: number = 0;

Defined in: src/engine/ui/components.ts:294

Inherited from

UIImage.scrollPaddingBottom


scrollPaddingLeft

scrollPaddingLeft: number = 0;

Defined in: src/engine/ui/components.ts:295

Inherited from

UIImage.scrollPaddingLeft


scrollPaddingRight

scrollPaddingRight: number = 0;

Defined in: src/engine/ui/components.ts:293

Inherited from

UIImage.scrollPaddingRight


scrollPaddingTop

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.

Inherited from

UIImage.scrollPaddingTop


scrollSnapAlignBlock

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

Inherited from

UIImage.scrollSnapAlignBlock


scrollSnapAlignInline

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

Inherited from

UIImage.scrollSnapAlignInline


scrollSnapAxis

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.

Inherited from

UIImage.scrollSnapAxis


scrollSnapStop

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.

Inherited from

UIImage.scrollSnapStop


scrollSnapStrictness

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.

Inherited from

UIImage.scrollSnapStrictness


scrollX

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.

Inherited from

UIImage.scrollX


scrollY

scrollY: number = 0;

Defined in: src/engine/ui/components.ts:260

Inherited from

UIImage.scrollY


src

src: string = "";

Defined in: src/engine/ui/components.ts:569

The video: a file in the project (asset:videos/intro.webm) or a URL.

Implementation of

UIMediaFields.src


top

top: UILength = "auto";

Defined in: src/engine/ui/components.ts:160

Inherited from

UIImage.top


transformMatrix

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.

Inherited from

UIImage.transformMatrix


transformOriginX

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.

Inherited from

UIImage.transformOriginX


transformOriginY

transformOriginY: UILength = "50%";

Defined in: src/engine/ui/components.ts:339

Inherited from

UIImage.transformOriginY


translateX

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

Inherited from

UIImage.translateX


translateY

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.

Inherited from

UIImage.translateY


verticalAlign

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.

Inherited from

UIImage.verticalAlign


visible

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

Inherited from

UIImage.visible


volume

volume: number = 1;

Defined in: src/engine/ui/components.ts:575

0..1.

Implementation of

UIMediaFields.volume


width

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

Inherited from

UIImage.width


willChange

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.

Inherited from

UIImage.willChange


zIndex

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.

Inherited from

UIImage.zIndex

Accessors

currentTime

Get Signature

get currentTime(): number;

Defined in: src/engine/ui/components.ts:608

Seconds; set it to seek.

Returns

number

Set Signature

set currentTime(seconds): void;

Defined in: src/engine/ui/components.ts:612

Parameters
seconds

number

Returns

void


duration

Get Signature

get duration(): number;

Defined in: src/engine/ui/components.ts:617

Seconds; NaN until known.

Returns

number


enabled

Get Signature

get enabled(): boolean;

Defined in: src/engine/core/Component.ts:63

Returns

boolean

Set Signature

set enabled(value): void;

Defined in: src/engine/core/Component.ts:67

Parameters
value

boolean

Returns

void

Inherited from

UIImage.enabled


ended

Get Signature

get ended(): boolean;

Defined in: src/engine/ui/components.ts:603

Returns

boolean


gameObject

Get Signature

get gameObject(): GameObject;

Defined in: src/engine/core/Component.ts:43

Unity-style alias for node.

Returns

GameObject

Inherited from

UIImage.gameObject


isActiveAndEnabled

Get Signature

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.

Returns

boolean

Inherited from

UIImage.isActiveAndEnabled


media

Get Signature

get media(): UIMediaSource | null;

Defined in: src/engine/ui/components.ts:583

The media element it shows: one made from src in a browser (null headless until one is set), or one a script set.

Returns

UIMediaSource | null

Set Signature

set media(source): void;

Defined in: src/engine/ui/components.ts:587

Parameters
source

UIMediaSource | null

Returns

void


node

Get Signature

get node(): GameObject;

Defined in: src/engine/core/Component.ts:38

The node this component is on.

Returns

GameObject

Inherited from

UIImage.node


owner

Get Signature

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

Returns

GameObject

Inherited from

UIImage.owner


paused

Get Signature

get paused(): boolean;

Defined in: src/engine/ui/components.ts:599

Returns

boolean


time

Get Signature

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

Returns

Readonly<TimeState>

Inherited from

UIImage.time


transform

Get Signature

get transform(): Transform;

Defined in: src/engine/core/Component.ts:57

The Transform of the node this component is on, if it has one.

Returns

Transform

Inherited from

UIImage.transform


world

Get Signature

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.

Returns

WorldHandle

Inherited from

UIImage.world

Methods

_onDetach()

_onDetach(): void;

Defined in: src/engine/ui/components.ts:640

Returns

void

Overrides

UIImage._onDetach


instantiate()

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.

Parameters

prefabPath

string

options?

InstantiateOptions = {}

Returns

GameObject

Inherited from

UIImage.instantiate


off()

off(type, listener): void;

Defined in: src/engine/ui/components.ts:626

Parameters

type

| "playing" | "waiting" | "error" | "play" | "pause" | "ended" | "timeupdate" | "durationchange" | "loadedmetadata" | "loadeddata" | "canplay" | "canplaythrough" | "volumechange" | "ratechange" | "seeking" | "seeked" | "progress" | "emptied"

listener

(e) => void

Returns

void


on()

on(type, listener): void;

Defined in: src/engine/ui/components.ts:622

Listen to a media event (play, pause, ended, timeupdate, volumechange, durationchange…).

Parameters

type

| "playing" | "waiting" | "error" | "play" | "pause" | "ended" | "timeupdate" | "durationchange" | "loadedmetadata" | "loadeddata" | "canplay" | "canplaythrough" | "volumechange" | "ratechange" | "seeking" | "seeked" | "progress" | "emptied"

listener

(e) => void

Returns

void


pause()

pause(): void;

Defined in: src/engine/ui/components.ts:595

Returns

void


play()

play(): Promise<void>;

Defined in: src/engine/ui/components.ts:591

Returns

Promise<void>

Clone this wiki locally