Slider
继承: Range
< Control
< CanvasItem
< Node
< Object
Abstract base class for sliders.
描述
Abstract base class for sliders, used to adjust a value by moving a grabber along a horizontal or vertical axis. Sliders are Range
-based controls.
属性
bool | editable |
FocusMode | focus_mode |
bool | scrollable |
float | step |
int | tick_count |
bool | ticks_on_borders |
主题属性
int | center_grabber |
int | grabber_offset |
Texture2D | grabber |
Texture2D | grabber_disabled |
Texture2D | grabber_highlight |
Texture2D | tick |
StyleBox | grabber_area |
StyleBox | grabber_area_highlight |
StyleBox | slider |
信号
drag_ended ( value_changed: bool
)
Emitted when dragging stops. If value_changed
is true, Range.value
is different from the value when you started the dragging.
drag_started ( )
Emitted when dragging is started. This is emitted before the corresponding Range.value_changed
signal.
属性说明
bool
editable = true
If true
, the slider can be interacted with. If false
, the value can be changed only by code.
bool
scrollable = true
If true
, the value can be changed using the mouse wheel.
int
tick_count = 0
Number of ticks displayed on the slider, including border ticks. Ticks are uniformly-distributed value markers.
bool
ticks_on_borders = false
If true
, the slider will display ticks for minimum and maximum values.
主题属性说明
int
center_grabber = 0
Boolean constant. If 1
, the grabber texture size will be ignored and it will fit within slider's bounds based only on its center position.
int
grabber_offset = 0
Vertical or horizontal offset of the grabber.
Texture2D
grabber
The texture for the grabber (the draggable element).
Texture2D
grabber_disabled
The texture for the grabber when it's disabled.
Texture2D
grabber_highlight
The texture for the grabber when it's focused.
Texture2D
tick
The texture for the ticks, visible when tick_count
is greater than 0.
StyleBox
grabber_area
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.
StyleBox
slider
The background for the whole slider. Affects the height or width of the grabber_area
.
本方法通常需要用户覆盖才能生效。
本方法无副作用,不会修改该实例的任何成员变量。
本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。
本方法用于构造某个类型。
调用本方法无需实例,可直接使用类名进行调用。
本方法描述的是使用本类型作为左操作数的有效运算符。
这个值是由下列位标志构成位掩码的整数。
无返回值。