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 (overrides Button)

bool

toggle_mode

true (overrides BaseButton)

Theme Properties

Color

font_color

Color( 0.88, 0.88, 0.88, 1 )

Color

font_color_disabled

Color( 0.9, 0.9, 0.9, 0.2 )

Color

font_color_focus

Color( 0.94, 0.94, 0.94, 1 )

Color

font_color_hover

Color( 0.94, 0.94, 0.94, 1 )

Color

font_color_hover_pressed

Color( 1, 1, 1, 1 )

Color

font_color_pressed

Color( 1, 1, 1, 1 )

int

check_vadjust

0

int

hseparation

4

Font

font

Texture

off

Texture

off_disabled

Texture

on

Texture

on_disabled

StyleBox

disabled

StyleBox

focus

StyleBox

hover

StyleBox

hover_pressed

StyleBox

normal

StyleBox

pressed


Theme Property Descriptions

Color font_color = Color( 0.88, 0.88, 0.88, 1 )

The CheckButton text's font color.


Color font_color_disabled = Color( 0.9, 0.9, 0.9, 0.2 )

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


Color font_color_focus = Color( 0.94, 0.94, 0.94, 1 )

The CheckButton text's font color when it's focused. Only replaces the normal text color of the button. Disabled, hovered, and pressed states take precedence over this color.


Color font_color_hover = Color( 0.94, 0.94, 0.94, 1 )

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


Color font_color_hover_pressed = Color( 1, 1, 1, 1 )

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


Color font_color_pressed = Color( 1, 1, 1, 1 )

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


int check_vadjust = 0

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


int hseparation = 4

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


Font font

The Font to use for the CheckButton text.


Texture off

The icon to display when the CheckButton is unchecked.


Texture off_disabled

The icon to display when the CheckButton is unchecked and disabled.


Texture on

The icon to display when the CheckButton is checked.


Texture on_disabled

The icon to display when the CheckButton is checked and disabled.


StyleBox disabled

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


StyleBox focus

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


StyleBox hover

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


StyleBox hover_pressed

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


StyleBox normal

The StyleBox to display as a background.


StyleBox pressed

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