EditorSpinSlider
Inherits: Range < Control < CanvasItem < Entity < Object
Description
Section titled “Description”Orblit editor’s control for editing numeric values.
This Control node is used in the editor’s Inspector dock to allow editing of numeric values. Can be used with EditorInspectorPlugin to recreate the same behavior.
If the Range.step value is 1, the EditorSpinSlider will display up/down arrows, similar to SpinBox. If the Range.step value is not 1, a slider will be displayed instead.
Properties
Section titled “Properties”| Type | Name | Default |
|---|---|---|
| ControlState | control_state |
0 |
| bool | deferred_drag_mode |
false |
| bool | editing_integer |
false |
| bool | flat |
false |
| Control.FocusMode | focus_mode |
2 (overrides Control) |
| String | label |
"" |
| bool | read_only |
false |
| BitField[Control.SizeFlags] | size_flags_vertical |
1 (overrides Control) |
| float | step |
1.0 (overrides Range) |
| String | suffix |
"" |
Signals
Section titled “Signals”grabbed
grabbed()
Emitted when the spinner/slider is grabbed.
ungrabbed
ungrabbed()
Emitted when the spinner/slider is ungrabbed.
updown_pressed
updown_pressed()
Emitted when the updown button is pressed.
value_focus_entered
value_focus_entered()
Emitted when the value form gains focus.
value_focus_exited
value_focus_exited()
Emitted when the value form loses focus.
Enumerations
Section titled “Enumerations”ControlState
enum ControlState
CONTROL_STATE_DEFAULT = 0
The type of control used will depend on the value of editing_integer. Up-down arrows if true, a slider if false.
CONTROL_STATE_PREFER_SLIDER = 1
A slider will always be used, even if editing_integer is enabled.
CONTROL_STATE_HIDE = 2
Neither the up-down arrows nor the slider will be shown.
Theme items
Section titled “Theme items”label_color
Color label_color (color) = Color(0, 0, 0, 1)
read_only_label_color
Color read_only_label_color (color) = Color(0, 0, 0, 1)
line_edit_margin
int line_edit_margin (constant) = 0
line_edit_margin_empty
int line_edit_margin_empty (constant) = 0
updown
Texture2D updown (icon)
updown_disabled
Texture2D updown_disabled (icon)
label_bg
StyleBox label_bg (style)
Property descriptions
Section titled “Property descriptions”control_state
ControlState control_state = 0
The state in which the control used to manipulate the value will be.
deferred_drag_mode
bool deferred_drag_mode = false
If true, changing via dragging is applied only at the end of the input (for example, when the user releases a mouse button).
editing_integer
bool editing_integer = false
If true, the EditorSpinSlider is considered to be editing an integer value. If false, the EditorSpinSlider is considered to be editing a floating-point value. This is used to determine whether a slider should be drawn by default. The slider is only drawn for floats; integers use up-down arrows similar to SpinBox instead, unless control_state is set to CONTROL_STATE_PREFER_SLIDER. It will also use EditorSettings.interface/inspector/integer_drag_speed instead of EditorSettings.interface/inspector/float_drag_speed if the slider is available.
flat
bool flat = false
If true, the slider will not draw background.
label
String label = ""
The text that displays to the left of the value.
read_only
bool read_only = false
If true, the slider can’t be interacted with.
suffix
String suffix = ""
The suffix to display after the value (in a faded color). This should generally be a plural word. You may have to use an abbreviation if the suffix is too long to be displayed.
