跳转到内容

ButtonOptions

此内容尚不支持你的语言。

Defined in: ui/widgets/button.ts:25

optional background?: UIVisualInit

Defined in: ui/widgets/button.ts:32

Background renderer config. Default: solid white quad.


optional disabled?: boolean

Defined in: ui/widgets/button.ts:46

Start in the disabled state (Interactable.enabled = false).


events: EntityEventQueue

Defined in: ui/widgets/button.ts:27


optional fadeDuration?: number

Defined in: ui/widgets/button.ts:44

Tween time for color/scale state changes. Default 0 (snap).


optional focusable?: boolean

Defined in: ui/widgets/button.ts:48

Participate in Tab traversal + Enter/Space activation. Default true.


optional node?: UINodeInit

Defined in: ui/widgets/button.ts:30

CSS-box layout. Default: fill the parent.


optional onClick?: (entity) => void

Defined in: ui/widgets/button.ts:51

number

void


optional parent?: number

Defined in: ui/widgets/button.ts:28


optional states?: 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).


optional tabIndex?: number

Defined in: ui/widgets/button.ts:50

Tab order within the focus ring. Default 0 (document order).


optional text?: 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