Repository navigation
API Class UIInputField
Defined in: src/engine/ui/components.ts:266
A one-line text field. Clicking it focuses it and starts typing; typing goes through a hidden DOM
<input>, so IME and paste work. While it's typing, keys go to it and Input.getKey* report false.
Navigation (ADR 0340) focuses it without typing: submit starts typing, and Tab, Shift+Tab, Escape and
the gamepad leave it. changed is
true for the frame after the player changed value, submitted for the frame after Enter was
pressed in it (both seen by every phase of that frame, like UIButton.clicked); a script writing
value never counts as a change.
UIFocusable
new UIInputField(): UIInputField;Defined in: src/engine/ui/components.ts:277
UIInputField
UIFocusable.constructor
alignItems: UIAlign = "stretch";Defined in: src/engine/ui/components.ts:93
UIFocusable.alignItems
backgroundColor: Color | null = null;Defined in: src/engine/ui/components.ts:136
Null: transparent.
UIFocusable.backgroundColor
borderColor: Color = Color.black;Defined in: src/engine/ui/components.ts:139
UIFocusable.borderColor
borderRadius: number = 0;Defined in: src/engine/ui/components.ts:137
UIFocusable.borderRadius
borderWidth: number = 0;Defined in: src/engine/ui/components.ts:138
UIFocusable.borderWidth
bottom: UILength = "auto";Defined in: src/engine/ui/components.ts:107
UIFocusable.bottom
color: Color = Color.white;Defined in: src/engine/ui/components.ts:274
display: UIDisplay = "flex";Defined in: src/engine/ui/components.ts:120
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.
UIFocusable.display
flexDirection: UIFlexDirection = "row";Defined in: src/engine/ui/components.ts:91
How this element lays out its children.
UIFocusable.flexDirection
flexGrow: number = 0;Defined in: src/engine/ui/components.ts:110
How much of the parent's free space this element takes, relative to its siblings.
UIFocusable.flexGrow
focusable: boolean = true;Defined in: src/engine/ui/components.ts:184
False takes it out of focus: navigation skips it and a click doesn't focus it.
UIFocusable.focusable
focusColor: Color;Defined in: src/engine/ui/components.ts:186
Drawn while it has focus and the last UI input was navigation, not the pointer.
UIFocusable.focusColor
font: string = "";Defined in: src/engine/ui/components.ts:272
A font file in the project, as UIText.font; empty is the bundled Inter. The text is drawn at weight 400.
fontSize: number = 16;Defined in: src/engine/ui/components.ts:273
gap: number = 0;Defined in: src/engine/ui/components.ts:95
Space between children.
UIFocusable.gap
height: UILength = "auto";Defined in: src/engine/ui/components.ts:102
UIFocusable.height
justifyContent: UIJustify = "flex-start";Defined in: src/engine/ui/components.ts:92
UIFocusable.justifyContent
left: UILength = "auto";Defined in: src/engine/ui/components.ts:108
UIFocusable.left
margin: number = 0;Defined in: src/engine/ui/components.ts:99
Space around the element, on every side.
UIFocusable.margin
maxLength: number = 0;Defined in: src/engine/ui/components.ts:270
0: no limit.
navDown: GameObject | null = null;Defined in: src/engine/ui/components.ts:191
UIFocusable.navDown
navigation: UINavigationMode = "auto";Defined in: src/engine/ui/components.ts:188
auto: explicit neighbours, else the nearest element that way; explicit: neighbours only; none: navigate doesn't leave it.
UIFocusable.navigation
navLeft: GameObject | null = null;Defined in: src/engine/ui/components.ts:192
UIFocusable.navLeft
navRight: GameObject | null = null;Defined in: src/engine/ui/components.ts:193
UIFocusable.navRight
navUp: GameObject | null = null;Defined in: src/engine/ui/components.ts:190
Explicit neighbours: where navigate up, down, left and right goes from here (null: the search, in auto).
UIFocusable.navUp
opacity: number = 1;Defined in: src/engine/ui/components.ts:112
0..1, multiplied into its children's.
UIFocusable.opacity
padding: number = 0;Defined in: src/engine/ui/components.ts:97
Space inside the element, on every side.
UIFocusable.padding
placeholder: string = "";Defined in: src/engine/ui/components.ts:268
placeholderColor: Color;Defined in: src/engine/ui/components.ts:275
positionType: UIPositionType = "relative";Defined in: src/engine/ui/components.ts:104
absolute takes the element out of its parent's flow, placed by top/right/bottom/left.
UIFocusable.positionType
raycastTarget: boolean = true;Defined in: src/engine/ui/components.ts:129
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.
UIFocusable.raycastTarget
right: UILength = "auto";Defined in: src/engine/ui/components.ts:106
UIFocusable.right
top: UILength = "auto";Defined in: src/engine/ui/components.ts:105
UIFocusable.top
value: string = "";Defined in: src/engine/ui/components.ts:267
visible: boolean = true;Defined in: src/engine/ui/components.ts:114
False hides the element and its children but keeps its space (a disabled component or inactive node takes none).
UIFocusable.visible
width: UILength = "auto";Defined in: src/engine/ui/components.ts:101
Pixels (120), a percentage of the parent ("50%") or "auto" (sized by its content).
UIFocusable.width
get changed(): boolean;Defined in: src/engine/ui/components.ts:308
True for the one frame the player changed the value (typed, pasted, deleted).
boolean
get enabled(): boolean;Defined in: src/engine/core/Component.ts:57
boolean
set enabled(value): void;Defined in: src/engine/core/Component.ts:61
boolean
void
UIFocusable.enabled
get focused(): boolean;Defined in: src/engine/ui/components.ts:292
True while it has focus. Set it to focus the field and start typing in it (as a click does), or to unfocus it; one element in a World has focus, so focusing one unfocuses the others.
boolean
set focused(value): void;Defined in: src/engine/ui/components.ts:296
True while it has focus.
boolean
void
UIFocusable.focused
get focusedChanged(): boolean;Defined in: src/engine/ui/components.ts:200
True for the one frame the player (the pointer or navigation) gave it focus or took it away, in every phase of that frame.
boolean
UIFocusable.focusedChanged
get gameObject(): GameObject;Defined in: src/engine/core/Component.ts:37
Unity-style alias for node.
UIFocusable.gameObject
get isActiveAndEnabled(): boolean;Defined in: src/engine/core/Component.ts:68
True when enabled, the node is active in the hierarchy, and the node is in a loaded world.
boolean
UIFocusable.isActiveAndEnabled
get node(): GameObject;Defined in: src/engine/core/Component.ts:32
The node this component is on.
UIFocusable.node
get owner(): GameObject;Defined in: src/engine/core/Component.ts:45
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).
UIFocusable.owner
get submitted(): boolean;Defined in: src/engine/ui/components.ts:313
True for the one frame Enter was pressed in the field while typing.
boolean
get time(): Readonly<TimeState>;Defined in: src/engine/core/Component.ts:93
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>
UIFocusable.time
get transform(): Transform;Defined in: src/engine/core/Component.ts:51
The Transform of the node this component is on, if it has one.
UIFocusable.transform
get typing(): boolean;Defined in: src/engine/ui/components.ts:303
True while it takes the keyboard: from a click, a script's focused = true or submit, until Escape, Tab or navigation leaves it.
boolean
get world(): WorldHandle;Defined in: src/engine/core/Component.ts:82
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.
UIFocusable.world
instantiate(prefabPath, options?): GameObject;Defined in: src/engine/core/Component.ts:103
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 = {}
UIFocusable.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