ButtonOptions
此内容尚不支持你的语言。
Defined in: ui/widgets/button.ts:25
Properties
Section titled “Properties”background?
Section titled “background?”
optionalbackground?:UIVisualInit
Defined in: ui/widgets/button.ts:32
Background renderer config. Default: solid white quad.
disabled?
Section titled “disabled?”
optionaldisabled?:boolean
Defined in: ui/widgets/button.ts:46
Start in the disabled state (Interactable.enabled = false).
events
Section titled “events”events:
EntityEventQueue
Defined in: ui/widgets/button.ts:27
fadeDuration?
Section titled “fadeDuration?”
optionalfadeDuration?:number
Defined in: ui/widgets/button.ts:44
Tween time for color/scale state changes. Default 0 (snap).
focusable?
Section titled “focusable?”
optionalfocusable?:boolean
Defined in: ui/widgets/button.ts:48
Participate in Tab traversal + Enter/Space activation. Default true.
optionalnode?:UINodeInit
Defined in: ui/widgets/button.ts:30
CSS-box layout. Default: fill the parent.
onClick?
Section titled “onClick?”
optionalonClick?: (entity) =>void
Defined in: ui/widgets/button.ts:51
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”void
parent?
Section titled “parent?”
optionalparent?:number
Defined in: ui/widgets/button.ts:28
states?
Section titled “states?”
optionalstates?:Record<string,ButtonStateVisual>
Defined in: ui/widgets/button.ts:42
Map of state name (e.g. “normal”, “hover”, “pressed”, “disabled”)
to its visual override. The $interaction driver writes the four
canonical state names; callers may add more (e.g. “loading”) and
flip them manually via setButtonState. Omit to default to the
active theme’s control roles (themeButtonStates).
tabIndex?
Section titled “tabIndex?”
optionaltabIndex?:number
Defined in: ui/widgets/button.ts:50
Tab order within the focus ring. Default 0 (document order).
optionaltext?:string|TextInit
Defined in: ui/widgets/button.ts:34
Label text. Omit to skip spawning a child label entity.
world:
World
Defined in: ui/widgets/button.ts:26