forked from processing/processing-web-archive
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstrain.xml
More file actions
executable file
·64 lines (42 loc) · 1.07 KB
/
Copy pathconstrain.xml
File metadata and controls
executable file
·64 lines (42 loc) · 1.07 KB
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
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>constrain()</name>
<category>Math</category>
<subcategory>Calculation</subcategory>
<usage>Web & Application</usage>
<example>
<image></image>
<code><![CDATA[
void draw()
{
background(204);
float mx = constrain(mouseX, 30, 70);
rect(mx-10, 40, 20, 20);
}
]]></code>
</example>
<description><![CDATA[Constrains a value to not exceed a maximum and minimum value.]]></description>
<syntax><![CDATA[
constrain(<kbd>value</kbd>, <kbd>min</kbd>, <kbd>max</kbd>)
]]></syntax>
<parameter>
<label>value</label>
<description><![CDATA[int or float: the value to constrain]]></description>
</parameter>
<parameter>
<label>min</label>
<description><![CDATA[int or float: minimum limit]]></description>
</parameter>
<parameter>
<label>max</label>
<description><![CDATA[int or float: maximum limit]]></description>
</parameter>
<returns>float or int (depending on the input values)</returns>
<related>
max()
min()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>PDE</partof>
</root>