Skip to content

API Class UIControlMapper

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

Class: UIControlMapper

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:172

A rebinding screen for one player: put it on any node (it draws on a screen canvas of its own, or just above a game's canvas it's under). Rows list the actions (actions, or every defined action), one per part for a composite binding (Move Up, Move Down…), with a keyboard and a gamepad cell. Clicking a cell (with the mouse, or submit on it after focus navigation brought focus there) waits for the player's next press (PlayerInput.rebind, adding a binding when the cell is empty; Escape cancels, as does hiding or removing the screen, or changing player, while it waits) and shows any conflict. Delete or Backspace on the focused cell, or Unbind (for the cell last focused), removes its binding (PlayerInput.unbind). Reset to defaults drops the player's changes; Save writes them with saveBindings.

Extends

Constructors

Constructor

new UIControlMapper(): UIControlMapper;

Returns

UIControlMapper

Inherited from

Component.constructor

Properties

accentColor

accentColor: Color;

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:213

The focused button's border (shown after mouse use too), and the cell waiting for a press.


actionLabels

actionLabels: Record<string, string> = {};

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:222

Display names by action name ({ jump: "Jump", "game.Vehicle:honk": "Horn" }); others are title-cased.


actions

actions: string = "";

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:176

The actions to list, comma-separated ("jump, move, game.Vehicle:honk"); empty lists every action of every action set but the engine's UI actions (engine.UIActions, listed only when named here).


backgroundColor

backgroundColor: Color;

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:208


cancelControls

cancelControls: string = "";

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:191

The controls that cancel a rebind, comma-separated ("<Keyboard>/escape, <Gamepad>/start"). Empty: the engine's default, Escape and the gamepad's back button (<Gamepad>/select, ADR 0656).


cellColor

cellColor: Color;

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:209


fontSize

fontSize: number = 18;

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:205


gamepad

gamepad: boolean = true;

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:182

Show the gamepad column.


glyphSize

glyphSize: number = 30;

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:207

Glyph height in UI pixels.


holdToToggleActions

holdToToggleActions: string = "";

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:199

Button actions with a press-to-toggle switch (hold-to-toggle), comma-separated.


hoverColor

hoverColor: Color;

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:210


invertYActions

invertYActions: string = "";

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:195

Vector or axis actions with an Invert Y toggle, comma-separated ("look").


keyboard

keyboard: boolean = true;

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:180

Show the keyboard (and mouse) column.


modal

modal: boolean = false;

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:178

Keep focus in the screen (its canvas's modal) while it's shown. Only for the canvas it makes; under a game's canvas, set that canvas's modal.


mutedColor

mutedColor: Color;

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:215


player

player: number = 0;

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:174

The player's index.


pressedColor

pressedColor: Color;

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:211


profile

profile: string = "";

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:184

Profile name for saveBindings (empty: player<index>).


repeatActions

repeatActions: string = "";

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:201

The button actions that repeat when repeat is on, comma-separated (empty: every button action).


sensitivityActions

sensitivityActions: string = "";

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:197

Actions with a sensitivity stepper, comma-separated.


showAccessibility

showAccessibility: boolean = false;

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:193

Show the accessibility section below the bindings: the rows the next four fields ask for, then repeat and the stick dead zone.


text

text: UIControlMapperText;

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:220

Words it shows (change them to translate). Display names for actions go in actionLabels.


textColor

textColor: Color = Color.white;

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:214


timeout

timeout: number = 10;

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:186

Seconds to wait for a press before giving up (0: wait until a press or a cancel control).


title

title: string = "Controls";

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:202


warningColor

warningColor: Color;

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:217

Conflicting bindings and warnings.


width

width: UILength = "720";

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:204

The panel's width in UI pixels (720), a percentage, or "auto".

Accessors

conflicts

Get Signature

get conflicts(): readonly string[];

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:259

The conflicts the last rebind reported, as "<context>: <action>".

Returns

readonly string[]


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

Component.enabled


focusedCell

Get Signature

get focusedCell(): UIControlMapperCell | null;

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:268

The binding cell that has focus (ADR 0340), or null when focus is elsewhere (an accessibility row, a button, another screen). Delete and Backspace unbind it. To move focus, set a cell's button.focused.

Returns

UIControlMapperCell | null


gameObject

Get Signature

get gameObject(): GameObject;

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

Unity-style alias for node.

Returns

GameObject

Inherited from

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

Component.isActiveAndEnabled


node

Get Signature

get node(): GameObject;

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

The node this component is on.

Returns

GameObject

Inherited from

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

Component.owner


rebinding

Get Signature

get rebinding(): 
  | {
  action: string;
  device: UIControlMapperDevice;
}
  | null;

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:249

The rebind being waited for, or null.

Returns

| { action: string; device: UIControlMapperDevice; } | null


resetButton

Get Signature

get resetButton(): UIButton | null;

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:278

Returns

UIButton | null


rows

Get Signature

get rows(): readonly UIControlMapperRow[];

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:239

The rows as last shown (empty before the first frame).

Returns

readonly UIControlMapperRow[]


saveButton

Get Signature

get saveButton(): UIButton | null;

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:282

Returns

UIButton | null


settings

Get Signature

get settings(): readonly UIControlMapperSetting[];

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:244

The accessibility rows as last shown (empty unless showAccessibility).

Returns

readonly UIControlMapperSetting[]


status

Get Signature

get status(): string;

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:254

The status line ("Press a key… (Esc to cancel)", a conflict, "Saved.").

Returns

string


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

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

Component.transform


unbindButton

Get Signature

get unbindButton(): UIButton | null;

Defined in: src/plugins/ui/runtime/UIControlMapper.ts:274

The Unbind, Reset and Save buttons (null before the first frame). Unbind acts on the focused binding cell, or the one last focused.

Returns

UIButton | null


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

Component.world

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

Component.instantiate

Clone this wiki locally