-
-
Notifications
You must be signed in to change notification settings - Fork 173
Expand file tree
/
Copy pathnew.xml
More file actions
executable file
·61 lines (42 loc) · 1.03 KB
/
Copy pathnew.xml
File metadata and controls
executable file
·61 lines (42 loc) · 1.03 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
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>new</name>
<category>Structure</category>
<subcategory></subcategory>
<usage>Web & Application</usage>
<example>
<image></image>
<code><![CDATA[
HLine h1 = new HLine();
float[] speeds = new float[3];
float ypos;
void setup() {
size(200, 200);
speeds[0] = 0.1;
speeds[1] = 2.0;
speeds[2] = 0.5;
}
void draw() {
ypos += speeds[int(random(3))];
if (ypos > width) {
ypos = 0;
}
h1.update(ypos);
}
class HLine {
void update(float y) {
line(0, y, width, y);
}
}
]]></code>
</example>
<description><![CDATA[
Creates a "new" object. The keyword <b>new</b> is typically used similarly to the applications in the above example. In this example, a new object "h1" of the datatype "HLine" is created. On the following line, a new array of floats called "speeds" is created.
]]></description>
<syntax></syntax>
<returns></returns>
<related></related>
<availability>1.0</availability>
<type>keyword</type>
<partof>PDE</partof>
</root>