 |
 |
 |
 |
Name |
|
setup() |
 |
|
|
Examples |
|
void setup() {
size(200, 200);
background(0);
noStroke();
fill(102);
}
int a = 0;
void loop() {
rect(a++%width, 10, 2, 80);
}
|
|
|
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 loop() begins executing. Variables declared within setup() are not accessible within loop(). |
 |
|
|
Syntax |
|
void setup() {
statements
}
|
 |
|
|
Parameters |
|
statements |
|
any valid statements
|
|
 |
|
|
Returns |
|
None |
 |
|
|
Usage |
|
Web & Application |
 |
|
|
Related |
|
loop() size() |
|