Files
processing4/mobile/web/reference/API/new.xml
2005-01-27 06:48:42 +00:00

71 lines
880 B
XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>new</name>
<category>Structure</category>
<subcategory></subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
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 loop() {
ypos += speeds[int(random(3))];
if (ypos &gt; width) {
ypos = 0;
}
h1.update(ypos);
}
class HLine {
void update(float y) {
line(0, y, width, y);
}
}
</code>
</example>
<description>
Dynamically creates an object.
</description>
<syntax>
new
</syntax>
<parameter>
<label></label>
</parameter>
<returns></returns>
<related></related>
<availability>1.0</availability>
<type>keyword</type>
<partof>PDE</partof>
<level>Extended</level>
</root>