CheckBox¶
Inherits: Button < BaseButton < Control < CanvasItem < Node < Object
二元选择(有或无)用户界面小部件。另请参阅CheckButton。
描述¶
复选框让用户做出二元选择,即在两个可能的选项中只选择一个。它在功能上类似于CheckButton,但外观不同。为了遵循用户体验,建议在切换它对某些东西没有直接影响时使用CheckBox。例如,当切换它只会在确认按钮被按下时做一些事情时,使用它。
参阅BaseButton,它包含了与该节点相关的常规属性和方法。
属性¶
align |
|
|
toggle_mode |
|
主题属性¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
Theme Property Descriptions¶
Color font_color
Default |
|
CheckBox
文本的字体颜色。
Color font_color_disabled
Default |
|
CheckBox
文本被禁用时的字体颜色。
Color font_color_focus
Default |
|
CheckBox
文本获得焦点时的字体颜色。只取代复选框的正常文本颜色。禁用、悬停和按下状态优先于这个颜色。
Color font_color_hover
Default |
|
CheckBox
文本在悬停时的字体颜色。
Color font_color_hover_pressed
Default |
|
当CheckBox
文本被悬停和按下时的字体颜色。
Color font_color_pressed
Default |
|
文本被按下时的字体颜色。
int check_vadjust
Default |
|
呈现复选图标时使用的垂直偏移量(以像素为单位)。
int hseparation
Default |
|
复选图标和文本之间的分隔(以像素为单位)。
Font font
用于CheckBox
文本的Font。
Texture checked
选中CheckBox
时显示的复选图标。
Texture checked_disabled
当CheckBox
被选中和禁用时要显示的勾选图标。
Texture radio_checked
如果将CheckBox
配置为单选按钮,则选中CheckBox
时显示的图标。
Texture radio_checked_disabled
Texture radio_unchecked
如果将CheckBox
配置为单选按钮,则取消选中CheckBox
时显示的图标。
Texture radio_unchecked_disabled
Texture unchecked
未选中CheckBox
时显示的复选图标。
Texture unchecked_disabled
当CheckBox
未被选中并被禁用时要显示的勾选图标。
StyleBox disabled
当CheckBox
被禁用时,作为背景显示的StyleBox。
StyleBox focus
当CheckBox
被聚焦时,作为背景显示的StyleBox。
StyleBox hover
当CheckBox
被悬停时作为背景显示的StyleBox。
StyleBox hover_pressed
当CheckBox
被悬停和按下时,作为背景显示的StyleBox。
StyleBox normal
StyleBox显示为背景。
StyleBox pressed
按下CheckBox
时,StyleBox显示为背景。