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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new FocusManagerState():
FocusManagerState
Returns
Section titled “Returns”FocusManagerState
Properties
Section titled “Properties”focusedEntity
Section titled “focusedEntity”focusedEntity:
number|null=null
Defined in: ui/input/focusable.ts:24
focusVisible
Section titled “focusVisible”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.
Methods
Section titled “Methods”blur()
Section titled “blur()”blur():
number|null
Defined in: ui/input/focusable.ts:49
Returns
Section titled “Returns”number | null
focus()
Section titled “focus()”focus(
entity,visible?):number|null
Defined in: ui/input/focusable.ts:42
visible = acquired by keyboard. Pointer presses pass false.
Parameters
Section titled “Parameters”entity
Section titled “entity”number
visible?
Section titled “visible?”boolean = false
Returns
Section titled “Returns”number | null
isVisiblyFocused()
Section titled “isVisiblyFocused()”isVisiblyFocused(
entity):boolean
Defined in: ui/input/focusable.ts:57
Whether entity holds focus AND that focus should be drawn.
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”boolean