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  

new

   
Examples  
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 draw() { 
  ypos += speeds[int(random(3))]; 
  if (ypos > width) { 
    ypos = 0; 
  } 
  h1.update(ypos); 
} 
 
class HLine { 
  void update(float y) { 
    line(0, y, width, y); 
  } 
} 
 

Description   Creates a "new" object. The keyword new is typically used similarly to the applications in the above example. In this example, a new object "h1" of the datatype "HLine" is created. On the following line, a new array of floats called "speeds" is created.
   
Syntax  
new 
   
Usage   Web & Application
   
 
 






   
 
Updated: Fri Jul 15 16:35:50 PDT 2005
 
 








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