EditorSpinSlider
Reckfell editor's control for editing numeric values.
Reckfell 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.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
EditorSpinSliderConstructor
public EditorSpinSlider();Properties8
ControlStateProperty
public EditorSpinSlider.ControlStateEnum ControlState { get; set; }The state in which the control used to manipulate the value will be.
DeferredDragModeProperty
public bool DeferredDragMode { get; set; }If true, changing via dragging is applied only at the end of the input (for example, when the user releases a mouse button).
EditingIntegerProperty
public bool EditingInteger { get; set; }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 EditorSpinSlider.ControlState is set to EditorSpinSlider.ControlStateEnum.PreferSlider. It will also use EditorSettings.interface/inspector/integer_drag_speed instead of EditorSettings.interface/inspector/float_drag_speed if the slider is available.
FlatProperty
public bool Flat { get; set; }If true, the slider will not draw background.
HideSliderProperty · Deprecated
public bool HideSlider { get; set; }If true, the slider and up/down arrows are hidden.
LabelProperty
public string Label { get; set; }The text that displays to the left of the value.
ReadOnlyProperty
public bool ReadOnly { get; set; }If true, the slider can't be interacted with.
SuffixProperty
public string Suffix { get; set; }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.
Methods16
GetControlStateEditorSpinSlider.ControlStateEnum
public EditorSpinSlider.ControlStateEnum GetControlState();EditorSpinSlider.ControlStateEnumGetLabelstring
public string GetLabel();stringGetSuffixstring
public string GetSuffix();stringIsDeferredDragModeEnabledbool
public bool IsDeferredDragModeEnabled();boolIsEditingIntegerbool
public bool IsEditingInteger();boolIsFlatbool
public bool IsFlat();boolIsHidingSliderbool
public bool IsHidingSlider();boolIsReadOnlybool
public bool IsReadOnly();boolSetControlStatevoid
public void SetControlState(EditorSpinSlider.ControlStateEnum state);| Name | Type | Default |
|---|---|---|
state | EditorSpinSlider.ControlStateEnum | — |
SetDeferredDragModeEnabledvoid
public void SetDeferredDragModeEnabled(bool enabled = true);| Name | Type | Default |
|---|---|---|
enabled | bool | true |
SetEditingIntegervoid
public void SetEditingInteger(bool editingInteger);| Name | Type | Default |
|---|---|---|
editingInteger | bool | — |
SetFlatvoid
public void SetFlat(bool flat);| Name | Type | Default |
|---|---|---|
flat | bool | — |
SetHideSlidervoid
public void SetHideSlider(bool hideSlider);| Name | Type | Default |
|---|---|---|
hideSlider | bool | — |
SetLabelvoid
public void SetLabel(string label);| Name | Type | Default |
|---|---|---|
label | string | — |
SetReadOnlyvoid
public void SetReadOnly(bool readOnly);| Name | Type | Default |
|---|---|---|
readOnly | bool | — |
SetSuffixvoid
public void SetSuffix(string suffix);| Name | Type | Default |
|---|---|---|
suffix | string | — |
Signals and events5
GrabbedEvent
public event Action Grabbed;Emitted when the spinner/slider is grabbed.
UngrabbedEvent
public event Action Ungrabbed;Emitted when the spinner/slider is ungrabbed.
UpdownPressedEvent
public event Action UpdownPressed;Emitted when the updown button is pressed.
ValueFocusEnteredEvent
public event Action ValueFocusEntered;Emitted when the value form gains focus.
ValueFocusExitedEvent
public event Action ValueFocusExited;Emitted when the value form loses focus.
EditorSpinSlider.ControlStateEnum
| Value | Description |
|---|---|
Default = 0 | The type of control used will depend on the value of |
Hide = 2 | Neither the up-down arrows nor the slider will be shown. |
PreferSlider = 1 | A slider will always be used, even if |
Theme properties
These are Theme resource keys, not C# properties. Use the matching Control GetTheme…() and AddTheme…Override() methods for each value type.
| Key and type | Description |
|---|---|
label_colorColor | Font color of the left label (see Color(0, 0, 0, 1) |
read_only_label_colorColor | Font color of the left label, when Color(0, 0, 0, 1) |
line_edit_marginint | Left margin of the internal 0 |
line_edit_margin_emptyint | Left margin of the internal 0 |
updownTexture2D | Single texture representing both the up and down buttons. |
updown_disabledTexture2D | Single texture representing both the up and down buttons, when the control is readonly or disabled. |
label_bgStyleBox | Background stylebox for the left label, displayed when |