Skip to content

CheckBox

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

A button that represents a binary choice.

CheckBox allows the user to choose one of only two possible options. It’s similar to CheckButton in functionality, but it has a different appearance. To follow established UX patterns, it’s recommended to use CheckBox when toggling it has no immediate effect on something. For example, it could be used when toggling it will only do something once a confirmation button is pressed.

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

When BaseButton.button_group specifies a ButtonGroup, CheckBox changes its appearance to that of a radio button and uses the various radio_* theme properties.

Type Name Default
HorizontalAlignment alignment 0 (overrides Button)
bool toggle_mode true (overrides BaseButton)

checkbox_checked_color

Color checkbox_checked_color (color) = Color(1, 1, 1, 1)

checkbox_unchecked_color

Color checkbox_unchecked_color (color) = Color(1, 1, 1, 1)

check_v_offset

int check_v_offset (constant) = 0

checked

Texture2D checked (icon)

checked_disabled

Texture2D checked_disabled (icon)

radio_checked

Texture2D radio_checked (icon)

radio_checked_disabled

Texture2D radio_checked_disabled (icon)

radio_unchecked

Texture2D radio_unchecked (icon)

radio_unchecked_disabled

Texture2D radio_unchecked_disabled (icon)

unchecked

Texture2D unchecked (icon)

unchecked_disabled

Texture2D unchecked_disabled (icon)