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.

EditorSpinSlider

繼承: Range < Control < CanvasItem < Node < Object

Godot 編輯器用於編輯數值的控制項。

說明

這個 Control 節點用於編輯器的屬性檢視器面板中,以允許編輯數值。可與 EditorInspectorPlugin 一起使用以達到相同的效果。

如果 Range.step 值是 1EditorSpinSlider 將會顯示向上/向下箭頭,類似於 SpinBox。如果 Range.step 值不是 1,將會顯示滑桿代替。

屬性

ControlState

control_state

0

bool

deferred_drag_mode

false

bool

editing_integer

false

bool

flat

false

FocusMode

focus_mode

2 (overrides Control)

bool

hide_slider

false

String

label

""

bool

read_only

false

BitField[SizeFlags]

size_flags_vertical

1 (overrides Control)

float

step

1.0 (overrides Range)

String

suffix

""

主題屬性

Texture2D

updown

Texture2D

updown_disabled


訊號

grabbed() 🔗

當微調器/滑桿被抓取時發出。


ungrabbed() 🔗

當微調器/滑桿取消抓取時發出。


updown_pressed() 🔗

Emitted when the updown button is pressed.


value_focus_entered() 🔗

值表單獲得焦點時發出。


value_focus_exited() 🔗

值表單丟失焦點時發出。


列舉

enum ControlState: 🔗

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.

ControlState CONTROL_STATE_PREFER_SLIDER = 1

A slider will always be used, even if editing_integer is enabled.

ControlState CONTROL_STATE_HIDE = 2

Neither the up-down arrows nor the slider will be shown.


屬性說明

ControlState control_state = 0 🔗

The state in which the control used to manipulate the value will be.


bool deferred_drag_mode = false 🔗

  • void set_deferred_drag_mode_enabled(value: bool)

  • bool is_deferred_drag_mode_enabled()

If true, changing via dragging is applied only at the end of the input (for example, when the user releases a mouse button).


bool editing_integer = false 🔗

  • void set_editing_integer(value: bool)

  • bool is_editing_integer()

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.


bool flat = false 🔗

  • void set_flat(value: bool)

  • bool is_flat()

如果為 true,則滑桿不會繪製背景。


bool hide_slider = false 🔗

  • void set_hide_slider(value: bool)

  • bool is_hiding_slider()

已棄用: Use control_state instead.

If true, the slider and up/down arrows are hidden.


String label = "" 🔗

在值的左側顯示的文字。


bool read_only = false 🔗

  • void set_read_only(value: bool)

  • bool is_read_only()

如果為 true,則無法與滑桿互動。


String suffix = "" 🔗

在值之後顯示的後綴(以一種淡化的顏色顯示)。這通常應該是一個複數形式的詞。如果後綴太長而無法顯示,可能必須使用縮寫。


主題屬性說明

Texture2D updown 🔗

Single texture representing both the up and down buttons.


Texture2D updown_disabled 🔗

Single texture representing both the up and down buttons, when the control is readonly or disabled.