mirror of
https://github.com/processing/processing4.git
synced 2026-02-12 10:00:42 +01:00
71 lines
880 B
XML
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 & 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 > 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>
|