Toggle#
- class UI.Toggle#
A control that is either checked or not. Added to a
UI.Canvasor aUI.Panel.Note
On its own a toggle is a check box. Put several of them in the same
UI.ToggleGroupand they become radio buttons, as only one toggle in a group can be checked at a time.Base class:UI.InputControlInherited Members
From
UI.InputControl:changedFrom
UI.Control:interactable,color,tooltipFrom
UI.Object:rect_transform,layout_element,visible,remove
-
checked:
boolean# Whether the toggle is checked.
- Attribute:
Can be read or written
Note
Checking a toggle that belongs to a
UI.ToggleGroupunchecks the rest of that group, whether or not it is on the screen.
-
group:
UI.ToggleGroup|nil# The group that the toggle belongs to, or
nilif it does not belong to one.- Attribute:
Can be read or written
Note
Only one toggle in a group can be checked at a time, so a group turns a set of toggles into radio buttons. A group does not have to contain the toggles, so they can be grouped independently of how they are laid out.