.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the Range.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _class_Range: Range ===== **Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` **Inherited By:** :ref:`SpinBox`, :ref:`ScrollBar`, :ref:`ProgressBar`, :ref:`TextureProgress`, :ref:`Slider` **Category:** Core Brief Description ----------------- Abstract base class for range-based controls. Member Functions ---------------- +----------------------------+-----------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_as_ratio` **(** **)** const | +----------------------------+-----------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_max` **(** **)** const | +----------------------------+-----------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_min` **(** **)** const | +----------------------------+-----------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_page` **(** **)** const | +----------------------------+-----------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_step` **(** **)** const | +----------------------------+-----------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_value` **(** **)** const | +----------------------------+-----------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_ratio_exp` **(** **)** const | +----------------------------+-----------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_using_rounded_values` **(** **)** const | +----------------------------+-----------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_as_ratio` **(** :ref:`float` value **)** | +----------------------------+-----------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_exp_ratio` **(** :ref:`bool` enabled **)** | +----------------------------+-----------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_max` **(** :ref:`float` maximum **)** | +----------------------------+-----------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_min` **(** :ref:`float` minimum **)** | +----------------------------+-----------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_page` **(** :ref:`float` pagesize **)** | +----------------------------+-----------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_step` **(** :ref:`float` step **)** | +----------------------------+-----------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_use_rounded_values` **(** :ref:`bool` enabled **)** | +----------------------------+-----------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_value` **(** :ref:`float` value **)** | +----------------------------+-----------------------------------------------------------------------------------------------------------------+ | void | :ref:`share` **(** :ref:`Node` with **)** | +----------------------------+-----------------------------------------------------------------------------------------------------------------+ | void | :ref:`unshare` **(** **)** | +----------------------------+-----------------------------------------------------------------------------------------------------------------+ Signals ------- - **changed** **(** **)** This signal is emitted when min, max, range or step change. - **value_changed** **(** :ref:`float` value **)** This signal is emitted when value changes. Member Variables ---------------- - :ref:`bool` **exp_edit** - If [code]true[/code] and [code]min_value[/code] is greater than 0, [code]value[/code] will be represented exponentially rather than linearly. - :ref:`float` **max_value** - Maximum value. Range is clamped if [code]value[/code] is greater than [code]max_value[/code]. Default value: 100. - :ref:`float` **min_value** - Minimum value. Range is clamped if [code]value[/code] is less than [code]min_value[/code]. Default value: 0. - :ref:`float` **page** - 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]. - :ref:`bool` **rounded** - If [code]true[/code], [code]value[/code] will always be rounded to the nearest integer. - :ref:`float` **step** - 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. - :ref:`float` **value** - Range's current value. Description ----------- Range is a base class for :ref:`Control` nodes that change a floating point *value* between a *minimum* and a *maximum*, using *step* and *page*, for example a :ref:`ScrollBar`. Member Function Description --------------------------- .. _class_Range_get_as_ratio: - :ref:`float` **get_as_ratio** **(** **)** const Return value mapped to 0 to 1 range. .. _class_Range_get_max: - :ref:`float` **get_max** **(** **)** const Return the maximum value. .. _class_Range_get_min: - :ref:`float` **get_min** **(** **)** const Return the minimum value. .. _class_Range_get_page: - :ref:`float` **get_page** **(** **)** const Return the page size, if page is 0, paging is disabled. .. _class_Range_get_step: - :ref:`float` **get_step** **(** **)** const Return the stepping, if step is 0, stepping is disabled. .. _class_Range_get_value: - :ref:`float` **get_value** **(** **)** const .. _class_Range_is_ratio_exp: - :ref:`bool` **is_ratio_exp** **(** **)** const .. _class_Range_is_using_rounded_values: - :ref:`bool` **is_using_rounded_values** **(** **)** const .. _class_Range_set_as_ratio: - void **set_as_ratio** **(** :ref:`float` value **)** Set value mapped to 0 to 1 (unit) range, it will then be converted to the actual value within min and max. .. _class_Range_set_exp_ratio: - void **set_exp_ratio** **(** :ref:`bool` enabled **)** .. _class_Range_set_max: - void **set_max** **(** :ref:`float` maximum **)** .. _class_Range_set_min: - void **set_min** **(** :ref:`float` minimum **)** Set minimum value, clamped range value to it if it's less. .. _class_Range_set_page: - void **set_page** **(** :ref:`float` pagesize **)** Set page size. Page is mainly used for scrollbars or anything that controls text scrolling. .. _class_Range_set_step: - void **set_step** **(** :ref:`float` step **)** Set step value. If step is 0, stepping will be disabled. .. _class_Range_set_use_rounded_values: - void **set_use_rounded_values** **(** :ref:`bool` enabled **)** .. _class_Range_set_value: - void **set_value** **(** :ref:`float` value **)** .. _class_Range_share: - void **share** **(** :ref:`Node` with **)** 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. .. _class_Range_unshare: - void **unshare** **(** **)** Stop Range from sharing its member variables with any other Range.