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.
Checking the stable version of the documentation...
CheckBox
繼承: Button < BaseButton < Control < CanvasItem < Node < Object
代表二元選項的按鈕。
說明
CheckBox 允許使用者在僅有的兩個可能的選項中選擇一個。它在功能上類似於 CheckButton,但外觀不同。為了遵循既定的 UX 模式,建議在切換而不會立即對某些內容產生影響時使用 CheckBox。例如,切換後只會在按下確認按鈕後才執行某些操作時,就可以使用它。
另見 BaseButton,其中包含與該節點相關的通用屬性和方法。
當 BaseButton.button_group 指定 ButtonGroup 時,CheckBox 的外觀將變為選項按鈕,並使用各種 radio_* 主題屬性。
屬性
alignment |
|
|
toggle_mode |
|
主題屬性
|
||
|
||
|
||
主題屬性說明
Color checkbox_checked_color = Color(1, 1, 1, 1) 🔗
The color of the checked icon when the checkbox is pressed.
Color checkbox_unchecked_color = Color(1, 1, 1, 1) 🔗
The color of the unchecked icon when the checkbox is not pressed.
算繪勾選圖示時使用的垂直偏移量(單位:圖元)。
勾選圖示,該 CheckBox 被勾選時顯示。
勾選圖示,該 CheckBox 被勾選且被禁用時顯示。
勾選圖示,該 CheckBox 被配置為選項按鈕、被勾選時顯示。
Texture2D radio_checked_disabled 🔗
勾選圖示,該 CheckBox 被配置為選項按鈕、被禁用且未勾選時顯示。
勾選圖示,該 CheckBox 被配置為選項按鈕、未勾選時顯示。
Texture2D radio_unchecked_disabled 🔗
勾選圖示,該 CheckBox 被配置為選項按鈕、被禁用且未勾選時顯示。
勾選圖示,該 CheckBox 未勾選時顯示。
Texture2D unchecked_disabled 🔗
勾選圖示,該 CheckBox 未勾選且被禁用時顯示。