Skip to content

API Class UIOption

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

Class: UIOption

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

ADR 0428: one choice of a UISelect (HTML's <option>): its text children are its label (or label, when set). Shown in its select's list; a click on it chooses it. interactable false is HTML's disabled.

Extends

Constructors

Constructor

new UIOption(): UIOption;

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

Returns

UIOption

Overrides

UIButton.constructor

Accessors

alignContent

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

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

Inherited from

UIButton.alignContent


alignItems

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

Inherited from

UIButton.alignItems


alignSelf

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

This element's alignment across its parent's direction; auto takes the parent's alignItems.

Inherited from

UIButton.alignSelf


aspectRatio

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

Width divided by height, kept when only one of them is set (aspect-ratio: 16 / 9); 0: none.

Inherited from

UIButton.aspectRatio


backdropBlur

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

Inherited from

UIButton.backdropBlur


backdropBrightness

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

Inherited from

UIButton.backdropBrightness


backdropContrast

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

Inherited from

UIButton.backdropContrast


backdropDropShadowBlur

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

Inherited from

UIButton.backdropDropShadowBlur


backdropDropShadowColor

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

Inherited from

UIButton.backdropDropShadowColor


backdropDropShadowOffsetX

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

Inherited from

UIButton.backdropDropShadowOffsetX


backdropDropShadowOffsetY

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

Inherited from

UIButton.backdropDropShadowOffsetY


backdropGrayscale

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

Inherited from

UIButton.backdropGrayscale


backdropHueRotate

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

Inherited from

UIButton.backdropHueRotate


backdropInvert

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

Inherited from

UIButton.backdropInvert


backdropOpacity

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

Inherited from

UIButton.backdropOpacity


backdropSaturate

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

Inherited from

UIButton.backdropSaturate


backdropSepia

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

Inherited from

UIButton.backdropSepia


backgroundColor

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

Null: transparent.

Inherited from

UIButton.backgroundColor


backgroundImage

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

Drawn over the background: url(asset:images/wood.png) (stretched to the box), linear-gradient(angle, stops…) or radial-gradient(stops…) (a circle at the centre), stops being a colour and an optional position in %. A gradient replaces backgroundColor. Empty: none.

Inherited from

UIButton.backgroundImage


borderBottomLeftRadius

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

Inherited from

UIButton.borderBottomLeftRadius


borderBottomRightRadius

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

Inherited from

UIButton.borderBottomRightRadius


borderBottomWidth

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

Inherited from

UIButton.borderBottomWidth


borderColor

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

Inherited from

UIButton.borderColor


borderLeftWidth

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

Inherited from

UIButton.borderLeftWidth


borderRadius

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

Every corner's radius, for the corners whose own radius below is -1.

Inherited from

UIButton.borderRadius


borderRightWidth

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

Inherited from

UIButton.borderRightWidth


borderTopLeftRadius

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

One corner's radius in UI pixels; -1 (the default) takes borderRadius. A stylesheet's border-radius with two to four values sets these, as CSS does (top-left, top-right, bottom-right, bottom-left).

Inherited from

UIButton.borderTopLeftRadius


borderTopRightRadius

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

Inherited from

UIButton.borderTopRightRadius


borderTopWidth

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

The border's width on one side (border-top-width …). Null (the default): borderWidth. Unequal sides draw each side as its own edge.

Inherited from

UIButton.borderTopWidth


borderWidth

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

The border's width on every side (border-width takes one to four values; border a width, solid or none, and a colour).

Inherited from

UIButton.borderWidth


bottom

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

Inherited from

UIButton.bottom


boxShadowBlur

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

How far the shadow blurs, in UI pixels (CSS's blur radius).

Inherited from

UIButton.boxShadowBlur


boxShadowColor

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

A shadow under the background, box-shadow: offset-x offset-y blur colour in a stylesheet (ADR 0422). It's drawn by the background, so a panel without a backgroundColor or gradient casts none. Null: no shadow.

Inherited from

UIButton.boxShadowColor


boxShadowOffsetX

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

The shadow's offset to the right, in UI pixels.

Inherited from

UIButton.boxShadowOffsetX


boxShadowOffsetY

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

The shadow's offset down, in UI pixels.

Inherited from

UIButton.boxShadowOffsetY


changed

Get Signature

get changed(): boolean;

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

ADR 0428: true for the one frame the player changed it (typed, toggled, dragged, chose), in every phase of that frame; a script's write never counts.

Returns

boolean

Inherited from

UIButton.changed


clicked

Get Signature

get clicked(): boolean;

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

True for the one frame a click on the button finished (pressed and released over it, or submit while it had focus), in every phase of that frame.

Returns

boolean

Inherited from

UIButton.clicked


direction

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

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

UIButton.direction


display

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

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

UIButton.display


draggable

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

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

UIButton.draggable


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

UIButton.enabled


filterBlur

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

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

Inherited from

UIButton.filterBlur


filterBrightness

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

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

Inherited from

UIButton.filterBrightness


filterContrast

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

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

Inherited from

UIButton.filterContrast


filterDropShadowBlur

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

Inherited from

UIButton.filterDropShadowBlur


filterDropShadowColor

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

drop-shadow()'s colour: a shadow of what's drawn (its shape, not its box). Null: none.

Inherited from

UIButton.filterDropShadowColor


filterDropShadowOffsetX

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

The drop shadow's offset right and down, and its blur, in UI pixels.

Inherited from

UIButton.filterDropShadowOffsetX


filterDropShadowOffsetY

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

Inherited from

UIButton.filterDropShadowOffsetY


filterGrayscale

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

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

Inherited from

UIButton.filterGrayscale


filterHueRotate

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

hue-rotate(), in degrees.

Inherited from

UIButton.filterHueRotate


filterInvert

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

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

Inherited from

UIButton.filterInvert


filterOpacity

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

opacity(): like opacity, applied as a filter step (after the ones before it). 1 as it is.

Inherited from

UIButton.filterOpacity


filterSaturate

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

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

Inherited from

UIButton.filterSaturate


filterSepia

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

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

Inherited from

UIButton.filterSepia


flexBasis

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

Its size along the parent's direction before growing and shrinking: pixels, a percentage, or "auto" (its width/height).

Inherited from

UIButton.flexBasis


flexDirection

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

How this element lays out its children.

Inherited from

UIButton.flexDirection


flexGrow

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

How much of the parent's free space this element takes, relative to its siblings.

Inherited from

UIButton.flexGrow


flexShrink

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

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

UIButton.flexShrink


flexWrap

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

Whether children that don't fit on one line wrap onto more (wrap-reverse: new lines go before the first).

Inherited from

UIButton.flexWrap


focusable

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

False takes it out of focus: navigation skips it and a click doesn't focus it.

Inherited from

UIButton.focusable


focusColor

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

Drawn while it has focus and the last UI input was navigation, not the pointer.

Inherited from

UIButton.focusColor


focused

Get Signature

get focused(): boolean;

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

True while it has focus (a click, a script or navigation gave it). Set it to focus or unfocus it.

Returns

boolean

Set Signature

set focused(value): void;

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

Parameters
value

boolean

Returns

void

Inherited from

UIButton.focused


focusedChanged

Get Signature

get focusedChanged(): boolean;

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

True for the one frame the player (the pointer or navigation) gave it focus or took it away, in every phase of that frame.

Returns

boolean

Inherited from

UIButton.focusedChanged


gameObject

Get Signature

get gameObject(): GameObject;

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

Unity-style alias for node.

Returns

GameObject

Inherited from

UIButton.gameObject


gap

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

Space between children.

Inherited from

UIButton.gap


height

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

Inherited from

UIButton.height


hoverColor

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

Inherited from

UIButton.hoverColor


hovered

Get Signature

get hovered(): boolean;

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

True while the pointer is over the button (and it's interactable).

Returns

boolean

Inherited from

UIButton.hovered


inert

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

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

UIButton.inert


interactable

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

False: it ignores the pointer (it still blocks it from the game), can't take focus, and matches :disabled (HTML's disabled attribute sets it false). ADR 0428: every control has it (buttons, fields, checkboxes, sliders, selects…).

Inherited from

UIButton.interactable


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

UIButton.isActiveAndEnabled


justifyContent

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

Inherited from

UIButton.justifyContent


label

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

Its label in place of its text (HTML's label attribute); empty: its text.


left

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

Inherited from

UIButton.left


margin

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

Space around the element, on every side.

Inherited from

UIButton.margin


marginBottom

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

Inherited from

UIButton.marginBottom


marginLeft

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

Inherited from

UIButton.marginLeft


marginRight

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

Inherited from

UIButton.marginRight


marginTop

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

Space around the element on one side (margin-top …; the margin shorthand takes one to four values). Null: margin.

Inherited from

UIButton.marginTop


maxHeight

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

Inherited from

UIButton.maxHeight


maxWidth

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

The largest size layout gives it: pixels, a percentage of the parent, or "none" (no maximum).

Inherited from

UIButton.maxWidth


minHeight

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

Inherited from

UIButton.minHeight


minWidth

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

The smallest size layout gives it: pixels, a percentage of the parent, or "auto" (no minimum).

Inherited from

UIButton.minWidth


navDown

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

Inherited from

UIButton.navDown


navigation

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

auto: explicit neighbours, else the nearest element that way; explicit: neighbours only; none: navigate doesn't leave it.

Inherited from

UIButton.navigation


navLeft

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

Inherited from

UIButton.navLeft


navRight

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

Inherited from

UIButton.navRight


navUp

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

Explicit neighbours: where navigate up, down, left and right goes from here (null: the search, in auto).

Inherited from

UIButton.navUp


node

Get Signature

get node(): GameObject;

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

The node this component is on.

Returns

GameObject

Inherited from

UIButton.node


opacity

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

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

Inherited from

UIButton.opacity


overflow

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

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

UIButton.overflow


overflowX

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

ADR 0427: the horizontal axis's overflow (overflow-x); null (the default) takes overflow.

Inherited from

UIButton.overflowX


overflowY

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

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

Inherited from

UIButton.overflowY


overscrollBehavior

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

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

UIButton.overscrollBehavior


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

UIButton.owner


padding

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

Space inside the element, on every side.

Inherited from

UIButton.padding


paddingBottom

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

Inherited from

UIButton.paddingBottom


paddingLeft

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

Inherited from

UIButton.paddingLeft


paddingRight

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

Inherited from

UIButton.paddingRight


paddingTop

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

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

UIButton.paddingTop


positionType

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

absolute takes the element out of its parent's flow, placed by top/right/bottom/left.

Inherited from

UIButton.positionType


pressed

Get Signature

get pressed(): boolean;

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

True from the press on the button until the pointer button is released.

Returns

boolean

Inherited from

UIButton.pressed


pressedColor

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

Inherited from

UIButton.pressedColor


raycastTarget

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

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

UIButton.raycastTarget


right

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

Inherited from

UIButton.right


rotate

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

How far it's drawn turned clockwise about its transform origin, in degrees (rotate: 45deg, 0.25turn, 1rad).

Inherited from

UIButton.rotate


scaleX

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

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

UIButton.scaleX


scaleY

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

Inherited from

UIButton.scaleY


scrollbarGutter

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

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

UIButton.scrollbarGutter


scrollbarThumbColor

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

ADR 0427: its scrollbars' thumb colour (scrollbar-color: thumb track); null: the default, a light grey.

Inherited from

UIButton.scrollbarThumbColor


scrollbarTrackColor

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

ADR 0427: its scrollbars' track colour; null: the default, a faint dark strip.

Inherited from

UIButton.scrollbarTrackColor


scrollbarWidth

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

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

Inherited from

UIButton.scrollbarWidth


scrollBehavior

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

ADR 0427: smooth animates scripted scrolling (scrollTo, scrollBy, scrollIntoView and navigation's); auto jumps.

Inherited from

UIButton.scrollBehavior


scrollMarginBottom

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

Inherited from

UIButton.scrollMarginBottom


scrollMarginLeft

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

Inherited from

UIButton.scrollMarginLeft


scrollMarginRight

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

Inherited from

UIButton.scrollMarginRight


scrollMarginTop

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

ADR 0432: this element's snap area outset from its border box (scroll-margin), UI pixels per side.

Inherited from

UIButton.scrollMarginTop


scrollPaddingBottom

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

Inherited from

UIButton.scrollPaddingBottom


scrollPaddingLeft

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

Inherited from

UIButton.scrollPaddingLeft


scrollPaddingRight

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

Inherited from

UIButton.scrollPaddingRight


scrollPaddingTop

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

ADR 0432: a scroller's snapport inset from its padding box (scroll-padding), UI pixels per side.

Inherited from

UIButton.scrollPaddingTop


scrollSnapAlignBlock

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

ADR 0432: how this element lines up in its scroller when snapped, vertically (scroll-snap-align's first value).

Inherited from

UIButton.scrollSnapAlignBlock


scrollSnapAlignInline

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

ADR 0432: …and horizontally (scroll-snap-align's second value; one value sets both).

Inherited from

UIButton.scrollSnapAlignInline


scrollSnapAxis

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

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

UIButton.scrollSnapAxis


scrollSnapStop

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

ADR 0432: always: a scroll gesture stops at this element's snap position rather than passing over it.

Inherited from

UIButton.scrollSnapStop


scrollSnapStrictness

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

ADR 0432: mandatory always rests on a snap position; proximity (the default) only near one.

Inherited from

UIButton.scrollSnapStrictness


scrollX

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

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

UIButton.scrollX


scrollY

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

Inherited from

UIButton.scrollY


selected

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


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

UIButton.time


top

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

Inherited from

UIButton.top


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

UIButton.transform


transformMatrix

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

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

UIButton.transformMatrix


transformOriginX

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

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

UIButton.transformOriginX


transformOriginY

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

Inherited from

UIButton.transformOriginY


translateX

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

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

UIButton.translateX


translateY

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

How far it's drawn moved down: pixels, or a percentage of its own height.

Inherited from

UIButton.translateY


type

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

ADR 0428: what a click does inside a UIForm: submit (the default, as in HTML) sends the form's submit event, reset puts its controls back as they were built, button nothing.

Inherited from

UIButton.type


value

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

What its select's value becomes when it's chosen; empty: its text.


verticalAlign

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

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

UIButton.verticalAlign


visible

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

False hides the element and its children but keeps its space (a disabled component or inactive node takes none).

Inherited from

UIButton.visible


width

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

Pixels (120), a percentage of the parent ("50%") or "auto" (sized by its content).

Inherited from

UIButton.width


willChange

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

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

UIButton.willChange


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

UIButton.world


zIndex

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

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

UIButton.zIndex

Methods

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

UIButton.instantiate

Clone this wiki locally