2017-09-12 20:42:36 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2023-03-01 00:44:37 +00:00
<class name= "Range" inherits= "Control" version= "4.1" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2017-09-12 20:42:36 +00:00
<brief_description >
Abstract base class for range-based controls.
</brief_description>
<description >
2022-06-08 09:42:51 +00:00
Range is a base class for [Control] nodes that change a floating-point [member value] between a [member min_value] and [member max_value], using a configured [member step] and [member page] size. See e.g. [ScrollBar] and [Slider] for examples of higher level nodes using Range.
2017-09-12 20:42:36 +00:00
</description>
<tutorials >
</tutorials>
<methods >
2022-03-10 07:17:38 +00:00
<method name= "_value_changed" qualifiers= "virtual" >
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "new_value" type= "float" />
2022-03-10 07:17:38 +00:00
<description >
2022-03-14 16:14:57 +00:00
Called when the [Range]'s value is changed (following the same conditions as [signal value_changed]).
2022-03-10 07:17:38 +00:00
</description>
</method>
2022-10-31 22:12:53 +00:00
<method name= "set_value_no_signal" >
<return type= "void" />
<param index= "0" name= "value" type= "float" />
<description >
Sets the [Range]'s current value to the specified [param value], without emitting the [signal value_changed] signal.
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "share" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "with" type= "Node" />
2017-09-12 20:42:36 +00:00
<description >
2022-03-14 16:14:57 +00:00
Binds two [Range]s 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.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "unshare" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2017-09-12 20:42:36 +00:00
<description >
2022-03-14 16:14:57 +00:00
Stops the [Range] from sharing its member variables with any other.
2017-09-12 20:42:36 +00:00
</description>
</method>
</methods>
<members >
2022-11-06 19:27:24 +00:00
<member name= "allow_greater" type= "bool" setter= "set_allow_greater" getter= "is_greater_allowed" default= "false" >
2019-06-29 13:24:23 +00:00
If [code]true[/code], [member value] may be greater than [member max_value].
2018-05-28 12:53:15 +00:00
</member>
2022-11-06 19:27:24 +00:00
<member name= "allow_lesser" type= "bool" setter= "set_allow_lesser" getter= "is_lesser_allowed" default= "false" >
2019-06-29 13:24:23 +00:00
If [code]true[/code], [member value] may be less than [member min_value].
2018-05-28 12:53:15 +00:00
</member>
2022-11-06 19:27:24 +00:00
<member name= "exp_edit" type= "bool" setter= "set_exp_ratio" getter= "is_ratio_exp" default= "false" >
2018-12-20 12:46:54 +00:00
If [code]true[/code], and [code]min_value[/code] is greater than 0, [code]value[/code] will be represented exponentially rather than linearly.
2017-09-12 20:42:36 +00:00
</member>
2022-11-06 19:27:24 +00:00
<member name= "max_value" type= "float" setter= "set_max" getter= "get_max" default= "100.0" >
2019-06-29 13:24:23 +00:00
Maximum value. Range is clamped if [code]value[/code] is greater than [code]max_value[/code].
2017-09-12 20:42:36 +00:00
</member>
2022-11-06 19:27:24 +00:00
<member name= "min_value" type= "float" setter= "set_min" getter= "get_min" default= "0.0" >
2019-06-29 13:24:23 +00:00
Minimum value. Range is clamped if [code]value[/code] is less than [code]min_value[/code].
2017-09-12 20:42:36 +00:00
</member>
2022-11-06 19:27:24 +00:00
<member name= "page" type= "float" setter= "set_page" getter= "get_page" default= "0.0" >
2017-09-23 23:27:45 +00:00
Page size. Used mainly for [ScrollBar]. ScrollBar's length is its size multiplied by [code]page[/code] over the difference between [code]min_value[/code] and [code]max_value[/code].
2017-09-12 20:42:36 +00:00
</member>
2019-06-29 19:22:15 +00:00
<member name= "ratio" type= "float" setter= "set_as_ratio" getter= "get_as_ratio" >
2018-01-11 22:38:35 +00:00
The value mapped between 0 and 1.
</member>
2022-11-06 19:27:24 +00:00
<member name= "rounded" type= "bool" setter= "set_use_rounded_values" getter= "is_using_rounded_values" default= "false" >
2019-06-29 13:24:23 +00:00
If [code]true[/code], [code]value[/code] will always be rounded to the nearest integer.
2017-09-12 20:42:36 +00:00
</member>
2023-01-07 19:37:21 +00:00
<member name= "size_flags_vertical" type= "int" setter= "set_v_size_flags" getter= "get_v_size_flags" overrides= "Control" enum= "Control.SizeFlags" default= "0" />
2022-11-09 07:59:49 +00:00
<member name= "step" type= "float" setter= "set_step" getter= "get_step" default= "0.01" >
2017-09-23 23:27:45 +00:00
If greater than 0, [code]value[/code] will always be rounded to a multiple of [code]step[/code]. If [code]rounded[/code] is also [code]true[/code], [code]value[/code] will first be rounded to a multiple of [code]step[/code] then rounded to the nearest integer.
2017-09-12 20:42:36 +00:00
</member>
2022-11-06 19:27:24 +00:00
<member name= "value" type= "float" setter= "set_value" getter= "get_value" default= "0.0" >
2022-10-31 22:12:53 +00:00
Range's current value. Changing this property (even via code) will trigger [signal value_changed] signal. Use [method set_value_no_signal] if you want to avoid it.
2017-09-12 20:42:36 +00:00
</member>
</members>
<signals >
<signal name= "changed" >
<description >
2018-08-19 04:29:12 +00:00
Emitted when [member min_value], [member max_value], [member page], or [member step] change.
2017-09-12 20:42:36 +00:00
</description>
</signal>
<signal name= "value_changed" >
2022-08-06 18:11:48 +00:00
<param index= "0" name= "value" type= "float" />
2017-09-12 20:42:36 +00:00
<description >
2022-03-14 16:14:57 +00:00
Emitted when [member 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 [signal value_changed], consider using a [i]debouncing[/i] [Timer] to call the function less often.
2022-08-11 17:52:19 +00:00
[b]Note:[/b] Unlike signals such as [signal LineEdit.text_changed], [signal value_changed] is also emitted when [param value] is set directly via code.
2017-09-12 20:42:36 +00:00
</description>
</signal>
</signals>
</class>