.. default-domain:: cs .. highlight:: csharp .. namespace:: KRPC.Client.Services.UI Toggle ====== .. class:: Toggle A control that is either checked or not. Added to a :type:`Canvas` or a :type:`Panel`. .. note:: On its own a toggle is a check box. Put several of them in the same :type:`ToggleGroup` and they become radio buttons, as only one toggle in a group can be checked at a time. | Base class: :type:`InputControl` .. container:: inherited-members .. rubric:: Inherited Members * From :type:`InputControl`: :prop:`Changed ` * From :type:`Control`: :prop:`Interactable `, :prop:`Color `, :prop:`Tooltip ` * From :type:`Object`: :prop:`RectTransform `, :prop:`LayoutElement `, :prop:`Visible `, :meth:`Remove ` .. property:: Text Text { get; } The text for the toggle. :Game Scenes: All .. property:: bool Checked { get; set; } Whether the toggle is checked. :Game Scenes: All .. note:: Checking a toggle that belongs to a :type:`ToggleGroup` unchecks the rest of that group, whether or not it is on the screen. .. property:: ToggleGroup Group { get; set; } The group that the toggle belongs to, or ``null`` if it does not belong to one. :Game Scenes: All .. 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.