Range.xml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Range" inherits="Control" category="Core" version="3.0.alpha.custom_build">
  3. <brief_description>
  4. Abstract base class for range-based controls.
  5. </brief_description>
  6. <description>
  7. Range is a base class for [Control] nodes that change a floating point [i]value[/i] between a [i]minimum[/i] and a [i]maximum[/i], using [i]step[/i] and [i]page[/i], for example a [ScrollBar].
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <demos>
  12. </demos>
  13. <methods>
  14. <method name="get_as_ratio" qualifiers="const">
  15. <return type="float">
  16. </return>
  17. <description>
  18. Return value mapped to 0 to 1 range.
  19. </description>
  20. </method>
  21. <method name="get_max" qualifiers="const">
  22. <return type="float">
  23. </return>
  24. <description>
  25. Return the maximum value.
  26. </description>
  27. </method>
  28. <method name="get_min" qualifiers="const">
  29. <return type="float">
  30. </return>
  31. <description>
  32. Return the minimum value.
  33. </description>
  34. </method>
  35. <method name="get_page" qualifiers="const">
  36. <return type="float">
  37. </return>
  38. <description>
  39. Return the page size, if page is 0, paging is disabled.
  40. </description>
  41. </method>
  42. <method name="get_step" qualifiers="const">
  43. <return type="float">
  44. </return>
  45. <description>
  46. Return the stepping, if step is 0, stepping is disabled.
  47. </description>
  48. </method>
  49. <method name="get_value" qualifiers="const">
  50. <return type="float">
  51. </return>
  52. <description>
  53. </description>
  54. </method>
  55. <method name="is_ratio_exp" qualifiers="const">
  56. <return type="bool">
  57. </return>
  58. <description>
  59. </description>
  60. </method>
  61. <method name="is_using_rounded_values" qualifiers="const">
  62. <return type="bool">
  63. </return>
  64. <description>
  65. </description>
  66. </method>
  67. <method name="set_as_ratio">
  68. <return type="void">
  69. </return>
  70. <argument index="0" name="value" type="float">
  71. </argument>
  72. <description>
  73. Set value mapped to 0 to 1 (unit) range, it will then be converted to the actual value within min and max.
  74. </description>
  75. </method>
  76. <method name="set_exp_ratio">
  77. <return type="void">
  78. </return>
  79. <argument index="0" name="enabled" type="bool">
  80. </argument>
  81. <description>
  82. </description>
  83. </method>
  84. <method name="set_max">
  85. <return type="void">
  86. </return>
  87. <argument index="0" name="maximum" type="float">
  88. </argument>
  89. <description>
  90. </description>
  91. </method>
  92. <method name="set_min">
  93. <return type="void">
  94. </return>
  95. <argument index="0" name="minimum" type="float">
  96. </argument>
  97. <description>
  98. Set minimum value, clamped range value to it if it's less.
  99. </description>
  100. </method>
  101. <method name="set_page">
  102. <return type="void">
  103. </return>
  104. <argument index="0" name="pagesize" type="float">
  105. </argument>
  106. <description>
  107. Set page size. Page is mainly used for scrollbars or anything that controls text scrolling.
  108. </description>
  109. </method>
  110. <method name="set_step">
  111. <return type="void">
  112. </return>
  113. <argument index="0" name="step" type="float">
  114. </argument>
  115. <description>
  116. Set step value. If step is 0, stepping will be disabled.
  117. </description>
  118. </method>
  119. <method name="set_use_rounded_values">
  120. <return type="void">
  121. </return>
  122. <argument index="0" name="enabled" type="bool">
  123. </argument>
  124. <description>
  125. </description>
  126. </method>
  127. <method name="set_value">
  128. <return type="void">
  129. </return>
  130. <argument index="0" name="value" type="float">
  131. </argument>
  132. <description>
  133. </description>
  134. </method>
  135. <method name="share">
  136. <return type="void">
  137. </return>
  138. <argument index="0" name="with" type="Node">
  139. </argument>
  140. <description>
  141. 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.
  142. </description>
  143. </method>
  144. <method name="unshare">
  145. <return type="void">
  146. </return>
  147. <description>
  148. Stop Range from sharing its member variables with any other Range.
  149. </description>
  150. </method>
  151. </methods>
  152. <members>
  153. <member name="exp_edit" type="bool" setter="set_exp_ratio" getter="is_ratio_exp">
  154. If [code]true[/code] and [code]min_value[/code] is greater than 0, [code]value[/code] will be represented exponentially rather than linearly.
  155. </member>
  156. <member name="max_value" type="float" setter="set_max" getter="get_max">
  157. Maximum value. Range is clamped if [code]value[/code] is greater than [code]max_value[/code]. Default value: 100.
  158. </member>
  159. <member name="min_value" type="float" setter="set_min" getter="get_min">
  160. Minimum value. Range is clamped if [code]value[/code] is less than [code]min_value[/code]. Default value: 0.
  161. </member>
  162. <member name="page" type="float" setter="set_page" getter="get_page">
  163. 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].
  164. </member>
  165. <member name="rounded" type="bool" setter="set_use_rounded_values" getter="is_using_rounded_values">
  166. If [code]true[/code], [code]value[/code] will always be rounded to the nearest integer.
  167. </member>
  168. <member name="step" type="float" setter="set_step" getter="get_step">
  169. 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.
  170. </member>
  171. <member name="value" type="float" setter="set_value" getter="get_value">
  172. Range's current value.
  173. </member>
  174. </members>
  175. <signals>
  176. <signal name="changed">
  177. <description>
  178. This signal is emitted when min, max, range or step change.
  179. </description>
  180. </signal>
  181. <signal name="value_changed">
  182. <argument index="0" name="value" type="float">
  183. </argument>
  184. <description>
  185. This signal is emitted when value changes.
  186. </description>
  187. </signal>
  188. </signals>
  189. <constants>
  190. </constants>
  191. </class>