ToggleOptions
此内容尚不支持你的语言。
Defined in: ui/widgets/toggle.ts:15
Properties
Section titled “Properties”background?
Section titled “background?”
optionalbackground?:UIVisualInit
Defined in: ui/widgets/toggle.ts:22
Background renderer for the frame.
check?
Section titled “check?”
optionalcheck?: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.
color?
Section titled “color?”
optionalcolor?:Color
optionalnode?:UINodeInit
sprite?
Section titled “sprite?”
optionalsprite?:number
disabled?
Section titled “disabled?”
optionaldisabled?:boolean
Defined in: ui/widgets/toggle.ts:42
Start disabled.
events
Section titled “events”events:
EntityEventQueue
Defined in: ui/widgets/toggle.ts:17
focusable?
Section titled “focusable?”
optionalfocusable?:boolean
Defined in: ui/widgets/toggle.ts:44
Participate in Tab traversal + Enter/Space activation. Default true.
interactionStates?
Section titled “interactionStates?”
optionalinteractionStates?: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).
optionalisOn?:boolean
Defined in: ui/widgets/toggle.ts:40
Initial on/off state.
optionalnode?:UINodeInit
Defined in: ui/widgets/toggle.ts:19
onChange?
Section titled “onChange?”
optionalonChange?: (isOn,entity) =>void
Defined in: ui/widgets/toggle.ts:47
Parameters
Section titled “Parameters”boolean
entity
Section titled “entity”number
Returns
Section titled “Returns”void
parent?
Section titled “parent?”
optionalparent?:number
Defined in: ui/widgets/toggle.ts:18
tabIndex?
Section titled “tabIndex?”
optionaltabIndex?:number
Defined in: ui/widgets/toggle.ts:45
world:
World
Defined in: ui/widgets/toggle.ts:16