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) 🔗
Emitted when the grabber stops being dragged. If value_changed is true, Range.value is different from the value when the dragging was started.
drag_started() 🔗
Emitted when the grabber starts being dragged. This is emitted before the corresponding Range.value_changed signal.
列舉
enum TickPosition: 🔗
TickPosition TICK_POSITION_BOTTOM_RIGHT = 0
Places the ticks at the bottom of the HSlider, or right of the VSlider.
TickPosition TICK_POSITION_TOP_LEFT = 1
Places the ticks at the top of the HSlider, or left of the VSlider.
TickPosition TICK_POSITION_BOTH = 2
Places the ticks at the both sides of the slider.
TickPosition TICK_POSITION_CENTER = 3
Places the ticks at the center of the slider.
屬性說明
如果為 true,則滑動條可以互動。如果為 false,則只能通過程式碼更改該值。
如果為 true,則可以使用滑鼠滾輪更改該值。
滑動條上顯示的刻度線數量,包括邊界刻度線。刻度是均勻分佈的數值標記。
bool ticks_on_borders = false 🔗
如果為 true,則滑動條將顯示最小值和最大值的刻度。
TickPosition ticks_position = 0 🔗
void set_ticks_position(value: TickPosition)
TickPosition get_ticks_position()
Sets the position of the ticks. See TickPosition for details.
主題屬性說明
布林常數。如果為 1,則會忽略抓取器紋理的大小,根據其中心位置將其縮放到捲軸的邊界。
Vertical or horizontal offset of the grabber.
Vertical or horizontal offset of the ticks. The offset is reversed for top or left ticks.
用作拖動條的紋理(可拖動的元素)。
抓取器禁用時的材質。
抓取器獲得焦點時的材質。
刻度的紋理。當 tick_count 大於 0 時可見。
The background of the area to the left or bottom of the grabber.
StyleBox grabber_area_highlight 🔗
The background of the area to the left or bottom of the grabber that displays when it's being hovered or focused.
The background for the whole slider. Affects the height or width of the grabber_area.