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...
Slider
繼承: Range < Control < CanvasItem < Node < Object
滑桿的抽象基底類別。
說明
滑桿的抽象基底類別,通過將抓取器(滑桿)沿水平軸或垂直軸移動類調整取值。滑桿是基於 Range 的控制項。
屬性
|
||
focus_mode |
|
|
|
||
step |
|
|
|
||
|
||
|
主題屬性
|
||
|
||
|
||
|
||
|
||
訊號
drag_ended(value_changed: bool) 🔗
停止拖動抓取器時發出。如果 value_changed 為 true,則 Range.value 與開始拖動時的值不同。
drag_started() 🔗
開始拖動抓取器時發出,時機在對應的 Range.value_changed 訊號之前。
列舉
enum TickPosition: 🔗
TickPosition TICK_POSITION_BOTTOM_RIGHT = 0
將刻度放置在 HSlider 的底部、VSlider 的右側。
TickPosition TICK_POSITION_TOP_LEFT = 1
將刻度放置在 HSlider 的頂部、VSlider 的左側。
TickPosition TICK_POSITION_BOTH = 2
在滑桿的兩側放置刻度。
TickPosition TICK_POSITION_CENTER = 3
在滑桿的中間放置刻度。
屬性說明
如果為 true,則滑動條可以互動。如果為 false,則只能通過程式碼更改該值。
如果為 true,則可以使用滑鼠滾輪更改該值。
滑動條上顯示的刻度線數量,包括邊界刻度線。刻度是均勻分佈的數值標記。
bool ticks_on_borders = false 🔗
如果為 true,則滑動條將顯示最小值和最大值的刻度。
TickPosition ticks_position = 0 🔗
void set_ticks_position(value: TickPosition)
TickPosition get_ticks_position()
設定刻度的位置。詳見 TickPosition。
主題屬性說明
布林常數。如果為 1,則會忽略抓取器紋理的大小,根據其中心位置將其縮放到捲軸的邊界。
The maximum allowed size of the Slider's grabber icon. The grabber texture is scaled down so its widest axis is grabber_max_size and the other axis is scaled keeping the original ratio.
抓取器的垂直或水平偏移量。
The maximum allowed size of the Slider's tick icons. The tick texture is scaled down so its widest axis is tick_max_size and the other axis is scaled keeping the original ratio.
刻度的垂直或水平偏移量。頂部和左側刻度的偏移量是反的。
用作拖動條的紋理(可拖動的元素)。
抓取器停用時的材質。
抓取器獲得焦點時的材質。
刻度的紋理。當 tick_count 大於 0 時可見。
AudioStream drag_ended_sound 🔗
Played when mouse or touch drag ends. This is also used by SpinBox when dragging over its arrows, or ColorPicker when dragging over its color wheel/rectangle.
AudioStream drag_started_sound 🔗
Played when mouse or touch drag begins. This is also used by SpinBox when dragging over its arrows, or ColorPicker when dragging over its color wheel/rectangle.
AudioStream focus_sound 🔗
Played when this Slider receives keyboard or gamepad-induced focus. Mouse or touch-induced focus does not play a focus sound.
AudioStream value_change_rejected_sound 🔗
Played when the value is attempted to be changed through keyboard or gamepad input, but the value is already at the minimum (or maximum).
AudioStream value_changed_sound 🔗
Played when the value is changed through keyboard or gamepad input. If the value is already at the minimum (or maximum), value_change_rejected_sound is played instead.
抓取器左側或底部區域的背景。
StyleBox grabber_area_highlight 🔗
抓取器被懸停或聚焦時,顯示的左側或底部區域的背景。
整個滑桿的背景。影響 grabber_area 的高度或寬度。