FocusBehavior
Defined in: ui/src/focus/FocusState.ts:21
What an element hands its own FocusState: the parts of focus only the element can answer for.
Properties
Section titled “Properties”focusableByDefault
Section titled “focusableByDefault”
readonlyfocusableByDefault:boolean
Defined in: ui/src/focus/FocusState.ts:26
Whether this kind of element takes focus when the game says nothing.
true for the pressable primitives, false for a panel or a label.
Methods
Section titled “Methods”activate()?
Section titled “activate()?”
optionalactivate():void
Defined in: ui/src/focus/FocusState.ts:39
Run the element’s own action, the one a click also runs.
Returns
Section titled “Returns”void
adjust()?
Section titled “adjust()?”
optionaladjust(direction):boolean
Defined in: ui/src/focus/FocusState.ts:45
Step the element’s own value along direction, returning true only
when the press was consumed. A stepper at its end returns false, so the
press moves focus out instead of being swallowed.
Parameters
Section titled “Parameters”direction
Section titled “direction”Returns
Section titled “Returns”boolean
isDisabled()?
Section titled “isDisabled()?”
optionalisDisabled():boolean
Defined in: ui/src/focus/FocusState.ts:28
Whether the element refuses focus and activation right now.
Returns
Section titled “Returns”boolean
paint()?
Section titled “paint()?”
optionalpaint(focused):void
Defined in: ui/src/focus/FocusState.ts:30
Paint the focused or the resting look.
Parameters
Section titled “Parameters”focused
Section titled “focused”boolean
Returns
Section titled “Returns”void
setPressed()?
Section titled “setPressed()?”
optionalsetPressed(pressed):void
Defined in: ui/src/focus/FocusState.ts:37
Paint the pressed or the unpressed look. Receives the combined press of
every device holding the element, so the resting look returns only once
the pointer has also let go. true can arrive more than once, so set the
face; do not toggle it. An element with no pressed look leaves this out.
Parameters
Section titled “Parameters”pressed
Section titled “pressed”boolean
Returns
Section titled “Returns”void
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.