FAQ
 
 
Cover  \ Exhibition  \ Learning  \ Reference  \ Download  \ Discourse   
      Language \ Environment \ Libraries \ Comparison
 
   
   
Abridged (A-Z) \ Complete (A-Z)  
   
  Reference for Processing (BETA) version 91+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.  
Name  

setup()

   
Examples  
void setup() { 
  size(200, 200); 
  background(0); 
  noStroke(); 
  fill(102); 
} 
 
int a = 0; 
 
void draw() { 
  rect(a++%width, 10, 2, 80); 
} 

Description   Called once when the program is started. Used to define initial enviroment properties such as screen size, background color, loading images, etc. before the draw() begins executing. Variables declared within setup() are not accessible within other functions, includingdraw(). There can only be one setup() function for each program and it should not be called again after it's initial execution.
   
Syntax  
void setup() {
  statements
}
   
Parameters  
statements   any valid statements

   
Returns   None
   
Usage   Web & Application
   
Related   loop()
size()
 
 






   
 
Updated: Fri Jul 15 16:36:08 PDT 2005
 
 








Creative Commons License
 
  Processing is an open project initiated by Ben Fry and Casey Reas  
  © Info