Files
godot-docs/classes/class_checkbutton.rst
2021-03-16 12:29:34 +01:00

74 lines
5.2 KiB
ReStructuredText

:github_url: hide
.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
.. DO NOT EDIT THIS FILE, but the CheckButton.xml source instead.
.. The source is found in doc/classes or modules/<name>/doc_classes.
.. _class_CheckButton:
CheckButton
===========
**Inherits:** :ref:`Button<class_Button>` **<** :ref:`BaseButton<class_BaseButton>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
Checkable button. See also :ref:`CheckBox<class_CheckBox>`.
Description
-----------
CheckButton is a toggle button displayed as a check field. It's similar to :ref:`CheckBox<class_CheckBox>` in functionality, but it has a different apperance. To follow established UX patterns, it's recommended to use CheckButton when toggling it has an **immediate** effect on something. For instance, it should be used if toggling it enables/disables a setting without requiring the user to press a confirmation button.
Properties
----------
+-----------------------------------------+-------------+------------------------------+
| :ref:`TextAlign<enum_Button_TextAlign>` | align | ``0`` *(parent override)* |
+-----------------------------------------+-------------+------------------------------+
| :ref:`bool<class_bool>` | toggle_mode | ``true`` *(parent override)* |
+-----------------------------------------+-------------+------------------------------+
Theme Properties
----------------
+---------------------------------+--------------------------+------------------------------+
| :ref:`int<class_int>` | check_vadjust | 0 |
+---------------------------------+--------------------------+------------------------------+
| :ref:`StyleBox<class_StyleBox>` | disabled | |
+---------------------------------+--------------------------+------------------------------+
| :ref:`StyleBox<class_StyleBox>` | focus | |
+---------------------------------+--------------------------+------------------------------+
| :ref:`Font<class_Font>` | font | |
+---------------------------------+--------------------------+------------------------------+
| :ref:`Color<class_Color>` | font_color | Color( 0.88, 0.88, 0.88, 1 ) |
+---------------------------------+--------------------------+------------------------------+
| :ref:`Color<class_Color>` | font_color_disabled | Color( 0.9, 0.9, 0.9, 0.2 ) |
+---------------------------------+--------------------------+------------------------------+
| :ref:`Color<class_Color>` | font_color_hover | Color( 0.94, 0.94, 0.94, 1 ) |
+---------------------------------+--------------------------+------------------------------+
| :ref:`Color<class_Color>` | font_color_hover_pressed | Color( 1, 1, 1, 1 ) |
+---------------------------------+--------------------------+------------------------------+
| :ref:`Color<class_Color>` | font_color_pressed | Color( 1, 1, 1, 1 ) |
+---------------------------------+--------------------------+------------------------------+
| :ref:`StyleBox<class_StyleBox>` | hover | |
+---------------------------------+--------------------------+------------------------------+
| :ref:`StyleBox<class_StyleBox>` | hover_pressed | |
+---------------------------------+--------------------------+------------------------------+
| :ref:`int<class_int>` | hseparation | 4 |
+---------------------------------+--------------------------+------------------------------+
| :ref:`StyleBox<class_StyleBox>` | normal | |
+---------------------------------+--------------------------+------------------------------+
| :ref:`Texture<class_Texture>` | off | |
+---------------------------------+--------------------------+------------------------------+
| :ref:`Texture<class_Texture>` | off_disabled | |
+---------------------------------+--------------------------+------------------------------+
| :ref:`Texture<class_Texture>` | on | |
+---------------------------------+--------------------------+------------------------------+
| :ref:`Texture<class_Texture>` | on_disabled | |
+---------------------------------+--------------------------+------------------------------+
| :ref:`StyleBox<class_StyleBox>` | pressed | |
+---------------------------------+--------------------------+------------------------------+
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`