Skip to content

FocusManagerState

Defined in: ui/input/focusable.ts:23

core-ui.ts

The stable UI surface promoted into the top-level esengine namespace (text, UINode box visuals, interaction, layout, theme).

This is the curated public UI API. The complete UI module surface — which also includes low-level text/atlas internals and engine-internal composition glue (e.g. EntityStateMap, ensureComponent) — lives in ./ui and is imported module-directly by the SDK code that needs it. Those internals are intentionally NOT re-exported here, so the public esengine namespace stays a stable, intentional surface.

Re-exported wholesale by core.ts.

new FocusManagerState(): FocusManagerState

FocusManagerState

focusedEntity: number | null = null

Defined in: ui/input/focusable.ts:24


focusVisible: boolean = false

Defined in: ui/input/focusable.ts:39

Whether the current focus should be SHOWN — the :focus-visible rule the web arrived at, for the same reason.

Focus follows a pointer press (so Enter/Space then act on what you clicked), but a clicked control that keeps a focus highlight reads as stuck: the pointer has moved on and the button is still lit, until you click something else. Only keyboard-acquired focus is worth drawing, because only then is the highlight the sole thing telling you where you are.

Lives here rather than on Focusable because it is per-session input state, like hover — authoring it into a scene would mean nothing.

blur(): number | null

Defined in: ui/input/focusable.ts:49

number | null


focus(entity, visible?): number | null

Defined in: ui/input/focusable.ts:42

visible = acquired by keyboard. Pointer presses pass false.

number

boolean = false

number | null


isVisiblyFocused(entity): boolean

Defined in: ui/input/focusable.ts:57

Whether entity holds focus AND that focus should be drawn.

number

boolean