CheckBox
继承: Button
< BaseButton
< Control
< CanvasItem
< Node
< 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.
属性
HorizontalAlignment | alignment |
bool | toggle_mode |
主题属性
主题属性说明
int
check_v_offset = 0
The vertical offset used when rendering the check icons (in pixels).
Texture2D
checked
The check icon to display when the CheckBox is checked.
Texture2D
checked_disabled
The check icon to display when the CheckBox is checked and is disabled.
Texture2D
radio_checked
The check icon to display when the CheckBox is configured as a radio button and is checked.
Texture2D
radio_checked_disabled
The check icon to display when the CheckBox is configured as a radio button, is disabled, and is unchecked.
Texture2D
radio_unchecked
The check icon to display when the CheckBox is configured as a radio button and is unchecked.
Texture2D
radio_unchecked_disabled
The check icon to display when the CheckBox is configured as a radio button, is disabled, and is unchecked.
Texture2D
unchecked
The check icon to display when the CheckBox is unchecked.
Texture2D
unchecked_disabled
The check icon to display when the CheckBox is unchecked and is disabled.
本方法通常需要用户覆盖才能生效。
本方法无副作用,不会修改该实例的任何成员变量。
本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。
本方法用于构造某个类型。
调用本方法无需实例,可直接使用类名进行调用。
本方法描述的是使用本类型作为左操作数的有效运算符。
这个值是由下列位标志构成位掩码的整数。
无返回值。