跳转到内容

ToggleOptions

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

Defined in: ui/widgets/toggle.ts:15

optional background?: UIVisualInit

Defined in: ui/widgets/toggle.ts:22

Background renderer for the frame.


optional check?: object

Defined in: ui/widgets/toggle.ts:33

Optional rendering for the on-state indicator (“check mark”). A child entity hidden when off, shown when on. Fills the parent by default; override via check.node.

optional color?: Color

optional node?: UINodeInit

optional sprite?: number


optional disabled?: boolean

Defined in: ui/widgets/toggle.ts:42

Start disabled.


events: EntityEventQueue

Defined in: ui/widgets/toggle.ts:17


optional focusable?: boolean

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

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


optional interactionStates?: Record<string, ButtonStateVisual>

Defined in: ui/widgets/toggle.ts:26

Interaction states (normal / hover / pressed / disabled) for the frame. Defaults to the active theme’s control roles (as createButton).


optional isOn?: boolean

Defined in: ui/widgets/toggle.ts:40

Initial on/off state.


optional node?: UINodeInit

Defined in: ui/widgets/toggle.ts:19


optional onChange?: (isOn, entity) => void

Defined in: ui/widgets/toggle.ts:47

boolean

number

void


optional parent?: number

Defined in: ui/widgets/toggle.ts:18


optional tabIndex?: number

Defined in: ui/widgets/toggle.ts:45


world: World

Defined in: ui/widgets/toggle.ts:16