Range
Inherits: Control < CanvasItem < Node < Object
Inherited By: EditorSpinSlider, ProgressBar, ScrollBar, Slider, SpinBox, TextureProgressBar
Abstract base class for controls that represent a number within a range.
Description
Range is an abstract base class for controls that represent a number within a range, using a configured step and page size. See e.g. ScrollBar and Slider for examples of higher-level nodes using Range.
Properties
| ||
| ||
| ||
| ||
| ||
| ||
| ||
BitField[SizeFlags] | size_flags_vertical |
|
| ||
|
Methods
void | _value_changed(new_value: float) virtual |
void | set_value_no_signal(value: float) |
void | |
void | unshare() |
Signals
changed() 🔗
Emitted when min_value, max_value, page, or step change.
Emitted when value changes. When used on a Slider, this is called continuously while dragging (potentially every frame). If you are performing an expensive operation in a function connected to value_changed, consider using a debouncing Timer to call the function less often.
Note: Unlike signals such as LineEdit.text_changed, value_changed is also emitted when value
is set directly via code.
Property Descriptions
If true
, value may be greater than max_value.
If true
, value may be less than min_value.
If true
, and min_value is greater than 0, value will be represented exponentially rather than linearly.
Maximum value. Range is clamped if value is greater than max_value.
Minimum value. Range is clamped if value is less than min_value.
Page size. Used mainly for ScrollBar. ScrollBar’s length is its size multiplied by page over the difference between min_value and max_value.
The value mapped between 0 and 1.
If true
, value will always be rounded to the nearest integer.
If greater than 0, value will always be rounded to a multiple of this property’s value. If rounded is also true
, value will first be rounded to a multiple of this property’s value, then rounded to the nearest integer.
Range’s current value. Changing this property (even via code) will trigger value_changed signal. Use set_value_no_signal if you want to avoid it.
Method Descriptions
void _value_changed(new_value: float) virtual 🔗
Called when the Range‘s value is changed (following the same conditions as value_changed).
void set_value_no_signal(value: float) 🔗
Sets the Range‘s current value to the specified value
, without emitting the value_changed signal.
Binds two Ranges together along with any ranges previously grouped with either of them. When any of range’s member variables change, it will share the new value with all other ranges in its group.
void unshare() 🔗
Stops the Range from sharing its member variables with any other.
User-contributed notes
Please read the User-contributed notes policy before submitting a comment.