CheckButton

Inherits: Button < BaseButton < Control < CanvasItem < Node < Object

Checkable button. See also CheckBox.

Description

CheckButton is a toggle button displayed as a check field. It's similar to CheckBox in functionality, but it has a different appearance. 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.

See also BaseButton which contains common properties and methods associated with this node.

Properties

TextAlign

align

0 (parent override)

bool

toggle_mode

true (parent override)

Theme Property Descriptions

  • int check_vadjust

Default

0

The vertical offset used when rendering the toggle icons (in pixels).


The StyleBox to display as a background when the CheckButton is disabled.


The StyleBox to display as a background when the CheckButton is focused.


The Font to use for the CheckButton text.


Default

Color(0.88, 0.88, 0.88, 1)

The CheckButton text's font color.


  • Color font_disabled_color

Default

Color(0.9, 0.9, 0.9, 0.2)

The CheckButton text's font color when it's disabled.


Default

Color(0.94, 0.94, 0.94, 1)

The CheckButton text's font color when it's hovered.


  • Color font_hover_pressed_color

Default

Color(1, 1, 1, 1)

The CheckButton text's font color when it's hovered and pressed.


  • Color font_outline_color

Default

Color(1, 1, 1, 1)

The tint of text outline of the CheckButton.


  • Color font_pressed_color

Default

Color(1, 1, 1, 1)

The CheckButton text's font color when it's pressed.


  • int font_size

Font size of the CheckButton's text.


The StyleBox to display as a background when the CheckButton is hovered.


The StyleBox to display as a background when the CheckButton is hovered and pressed.


  • int hseparation

Default

4

The separation between the toggle icon and the text (in pixels).


The StyleBox to display as a background.


The icon to display when the CheckButton is unchecked (for left-to-right layouts).


The icon to display when the CheckButton is unchecked and disabled (for left-to-right layouts).


The icon to display when the CheckButton is unchecked and disabled (for right-to-left layouts).


The icon to display when the CheckButton is unchecked (for right-to-left layouts).


The icon to display when the CheckButton is checked (for left-to-right layouts).


The icon to display when the CheckButton is checked and disabled (for left-to-right layouts).


The icon to display when the CheckButton is checked and disabled (for right-to-left layouts).


The icon to display when the CheckButton is checked (for right-to-left layouts).


  • int outline_size

Default

0

The size of the text outline.


The StyleBox to display as a background when the CheckButton is pressed.