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