ButtonGroup
继承: Resource < RefCounted < Object
不允许同时按下多个按钮的按钮的一个分组。
描述
BaseButton 派生按钮的分组。ButtonGroup 中的按钮被视为单选按钮:同一时间最多只能按下一个按钮。某些类型的按钮(例如 CheckBox)在该状态下可能会有特殊的外观。
ButtonGroup 的每个成员都应该将 BaseButton.toggle_mode 设置为 true
。
属性
| ||
resource_local_to_scene |
|
方法
get_buttons ( ) | |
信号
pressed ( BaseButton button )
当该组中的某个按钮被按下时发出。
属性说明
bool allow_unpress = false
如果为 true
,则可以取消按下该 ButtonGroup 中的所有按钮。
方法说明
BaseButton[] get_buttons ( )
返回元素类型为 Button 的 Array,这些 Button 将其作为 ButtonGroup(见 BaseButton.button_group)。
BaseButton get_pressed_button ( )
返回当前按下的按钮。
© 版权所有 2014-present Juan Linietsky, Ariel Manzur and the Godot community (CC BY 3.0). Revision b1c660f7
.
Built with Sphinx using a theme provided by Read the Docs.