Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

ButtonGroup

Inherits: Resource < RefCounted < Object

Group of Buttons.

Description

Group of BaseButton. The members of this group are treated like radio buttons in the sense that only one button can be pressed at the same time. Some types of buttons (such as CheckBox) may have a special appearance for this state.

Every member of the ButtonGroup should have BaseButton.toggle_mode set to true.

Properties

bool

allow_unpress

false

bool

resource_local_to_scene

true (overrides Resource)

Methods

BaseButton[]

get_buttons ( )

BaseButton

get_pressed_button ( )


Signals

pressed ( BaseButton button )

Emitted when one of the buttons of the group is pressed.


Property Descriptions

bool allow_unpress = false

  • void set_allow_unpress ( bool value )

  • bool is_allow_unpress ( )

If true, it is possible to unpress all buttons in this ButtonGroup.


Method Descriptions

BaseButton[] get_buttons ( )

Returns an Array of Buttons who have this as their ButtonGroup (see BaseButton.button_group).


BaseButton get_pressed_button ( )

Returns the current pressed button.