Skip to content

UIFocusSystem

Defined in: ui/src/UIFocusSystem.ts:31

Drives keyboard and gamepad focus: one scope, once a frame.

Runs in LateUpdate at priority 202, after UILayoutSystem and the React root layout (both 200) and the floating overlay (201), so every rectangle it searches was computed this frame.

It walks the whole scene stack, paused scenes included, so a pause menu shown over a paused scene takes the keyboard. Layout and hit testing are not filtered by pause either.

  • System

new UIFocusSystem(): UIFocusSystem

UIFocusSystem

System.constructor

protected context: EngineContext

Defined in: core/dist/index.d.ts:1336

Reference to the engine context, set on registration.

System.context


enabled: boolean

Defined in: core/dist/index.d.ts:1334

Whether this system is active.

System.enabled


readonly phase: LateUpdate = Phase.LateUpdate

Defined in: ui/src/UIFocusSystem.ts:32

The phase this system runs in.

System.phase


readonly priority: 202 = 202

Defined in: ui/src/UIFocusSystem.ts:33

Execution priority within the phase. Lower = earlier. Default: 0.

System.priority

_setContext(context): void

Defined in: core/dist/index.d.ts:1343

Internal

Set the engine context. Called by SystemScheduler when the system is registered.

EngineContext

void

System._setContext


onRegister(context): void

Defined in: ui/src/UIFocusSystem.ts:41

Called once when the system is registered with the engine.

EngineContext

void

System.onRegister


optional onUnregister(): void

Defined in: core/dist/index.d.ts:1351

Called when the system is removed.

void

System.onUnregister


update(): void

Defined in: ui/src/UIFocusSystem.ts:46

Called every frame (or every fixed step for FixedUpdate).

void

System.update


protected use<T>(key): T

Defined in: core/dist/index.d.ts:1345

Resolve a service by key, cached after first lookup.

T

ServiceKey<T>

T

System.use

Coding agents: fetch https://yage.dev/llms.txt first and prefer the Markdown references it links over these HTML pages. This page's Markdown counterpart is /llms/packages/ui.md.