Toggle#
-
class Toggle#
A control that is either checked or not. Added to a
Canvasor aPanel.Note
On its own a toggle is a check box. Put several of them in the same
ToggleGroupand they become radio buttons, as only one toggle in a group can be checked at a time.Base class:InputControlInherited Members
From
InputControl:changed,set_changedFrom
Control:interactable,set_interactable,color,set_color,tooltip,set_tooltipFrom
Object:rect_transform,layout_element,visible,set_visible,remove
-
bool checked()#
-
void set_checked(bool value)#
Whether the toggle is checked.
Note
Checking a toggle that belongs to a
ToggleGroupunchecks the rest of that group, whether or not it is on the screen.
-
std::optional<ToggleGroup> group()#
-
void set_group(std::optional<ToggleGroup> value)#
The group that the toggle belongs to, or
NULLif it does not belong to one.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.