Range
Inherits: Control < CanvasItem < Node < Object Inherited By: EditorSpinSlider, ProgressBar, ScrollBar, Slider, SpinBox, TextureProgress Abstract base class for range-based controls.
Description
Control nodes that change a floating-point value between a min_value and max_value, using a configured step and page size. See e.g. ScrollBar and Slider for examples of higher level nodes using Range.
Properties
Methods
Signals
- changed ( ) min_value, max_value, page, or step change.
- value_changed ( float value )
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
valueis set directly via code.Property Descriptions
- bool allow_greater
true, value may be greater than max_value.
- bool allow_lesser
true, value may be less than min_value.
- bool exp_edit
true, andmin_valueis greater than 0,valuewill be represented exponentially rather than linearly.
- float max_value
valueis greater thanmax_value.
- float min_value
valueis less thanmin_value.
- float page
ScrollBar. ScrollBar’s length is its size multiplied by
pageover the difference betweenmin_valueandmax_value.
- float ratio The value mapped between 0 and 1.
- bool rounded
true,valuewill always be rounded to the nearest integer.
- float step
valuewill always be rounded to a multiple ofstep. Ifroundedis alsotrue,valuewill first be rounded to a multiple ofstepthen rounded to the nearest integer.
- float value
Range’s current value.
Method Descriptions
- share ( Node with )
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.
- unshare ( )
Rangefrom sharing its member variables with any other.
