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

65 lines
1013 B
XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>setup()</name>
<category>Structure</category>
<subcategory></subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
void setup() {
size(200, 200);
background(0);
noStroke();
fill(102);
}
int a = 0;
void draw() {
rect(a++%width, 10, 2, 80);
}
</code>
</example>
<description>
Function called once when the program begins running. Used to define initial enviroment properties such as screen size, background color, loading images, etc. before the <b>draw()</b> begins executing. Variables declared within <b>setup()</b> are not accessible within <b>draw()</b>.
</description>
<syntax>
void setup() {
<c>statements</c>
}
</syntax>
<parameter>
<label>statements</label>
<description>any valid statements</description>
</parameter>
<returns>None</returns>
<related>
loop()
size()
</related>
<availability>1.0</availability>
<type>Processing Function</type>
<partof>PDE</partof>
</root>