class_range.rst 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the Range.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_Range:
  5. Range
  6. =====
  7. **Inherits:** :ref:`Control<class_control>` **<** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  8. **Inherited By:** :ref:`SpinBox<class_spinbox>`, :ref:`ScrollBar<class_scrollbar>`, :ref:`ProgressBar<class_progressbar>`, :ref:`TextureProgress<class_textureprogress>`, :ref:`Slider<class_slider>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Abstract base class for range-based controls.
  13. Member Functions
  14. ----------------
  15. +-------+--------------------------------------------------------------------------+
  16. | void | :ref:`share<class_Range_share>` **(** :ref:`Node<class_node>` with **)** |
  17. +-------+--------------------------------------------------------------------------+
  18. | void | :ref:`unshare<class_Range_unshare>` **(** **)** |
  19. +-------+--------------------------------------------------------------------------+
  20. Signals
  21. -------
  22. .. _class_Range_changed:
  23. - **changed** **(** **)**
  24. This signal is emitted when min, max, range or step change.
  25. .. _class_Range_value_changed:
  26. - **value_changed** **(** :ref:`float<class_float>` value **)**
  27. This signal is emitted when value changes.
  28. Member Variables
  29. ----------------
  30. .. _class_Range_exp_edit:
  31. - :ref:`bool<class_bool>` **exp_edit** - If ``true`` and ``min_value`` is greater than 0, ``value`` will be represented exponentially rather than linearly.
  32. .. _class_Range_max_value:
  33. - :ref:`float<class_float>` **max_value** - Maximum value. Range is clamped if ``value`` is greater than ``max_value``. Default value: 100.
  34. .. _class_Range_min_value:
  35. - :ref:`float<class_float>` **min_value** - Minimum value. Range is clamped if ``value`` is less than ``min_value``. Default value: 0.
  36. .. _class_Range_page:
  37. - :ref:`float<class_float>` **page** - Page size. Used mainly for :ref:`ScrollBar<class_scrollbar>`. ScrollBar's length is its size multiplied by ``page`` over the difference between ``min_value`` and ``max_value``.
  38. .. _class_Range_ratio:
  39. - :ref:`float<class_float>` **ratio** - The value mapped between 0 and 1.
  40. .. _class_Range_rounded:
  41. - :ref:`bool<class_bool>` **rounded** - If ``true``, ``value`` will always be rounded to the nearest integer.
  42. .. _class_Range_step:
  43. - :ref:`float<class_float>` **step** - If greater than 0, ``value`` will always be rounded to a multiple of ``step``. If ``rounded`` is also ``true``, ``value`` will first be rounded to a multiple of ``step`` then rounded to the nearest integer.
  44. .. _class_Range_value:
  45. - :ref:`float<class_float>` **value** - Range's current value.
  46. Description
  47. -----------
  48. Range is a base class for :ref:`Control<class_control>` nodes that change a floating point *value* between a *minimum* and a *maximum*, using *step* and *page*, for example a :ref:`ScrollBar<class_scrollbar>`.
  49. Member Function Description
  50. ---------------------------
  51. .. _class_Range_share:
  52. - void **share** **(** :ref:`Node<class_node>` with **)**
  53. 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.
  54. .. _class_Range_unshare:
  55. - void **unshare** **(** **)**
  56. Stop Range from sharing its member variables with any other Range.