Class Range
Abstract base class for controls that represent a number within a range.
- Inheritance
-
Range
- Derived
Remarks
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
allow_greater
var allow_greater : bool = false
Property Value
Remarks
allow_lesser
var allow_lesser : bool = false
Property Value
Remarks
exp_edit
If true
, and min_value is greater than 0, value will be represented exponentially rather than linearly.
var exp_edit : bool = false
Property Value
Remarks
max_value
var max_value : float = 100.0
Property Value
Remarks
min_value
var min_value : float = 0.0
Property Value
Remarks
page
Page size. Used mainly for ScrollBar. A ScrollBar's grabber length is the ScrollBar's size multiplied by page over the difference between min_value and max_value.
var page : float = 0.0
Property Value
Remarks
ratio
The value mapped between 0 and 1.
var ratio : float
Property Value
Remarks
rounded
If true
, value will always be rounded to the nearest integer.
var rounded : bool = false
Property Value
Remarks
step
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.
var step : float = 0.01
Property Value
Remarks
value
Range's current value. Changing this property (even via code) will trigger Range.value_changed signal. Use Range.set_value_no_signal if you want to avoid it.
var value : float = 0.0
Property Value
Remarks
Methods
_value_changed(float)
Qualifiers: virtual
Called when the Range's value is changed (following the same conditions as Range.value_changed).
void _value_changed(float new_value)
Parameters
new_value
float
set_value_no_signal(float)
Sets the Range's current value to the specified value
, without emitting the Range.value_changed signal.
void set_value_no_signal(float value)
Parameters
value
float
share(Node)
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 share(Node with)
Parameters
with
Node
unshare
Stops the Range from sharing its member variables with any other.
void unshare
Events
changed
signal changed
value_changed(float)
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 Range.value_changed, consider using a debouncing Timer to call the function less often.
Note: Unlike signals such as LineEdit.text_changed, Range.value_changed is also emitted when value
is set directly via code.
signal value_changed(float value)
Parameters
value
float