FAQ
 
 
Cover  \ Exhibition  \ Learning  \ Reference  \ Download  \ Discourse   
    Examples \ Tutorials \ Courses & Workshops
 
   
 
 
Examples for Processing (BETA) version 91+. If you have a previous version, use the examples included with your software. If you see any errors or have comments, please let us know.



Mouse 2D
by REAS <http://reas.com>

Moving the mouse changes the position and size of each box.

Updated 21 August 2002

   
// Mouse 2D 
// by REAS <http://reas.com> 

void setup() 
{ 
  size(200, 200); 
  noStroke(); 
  colorMode(RGB, 255, 255, 255, 100); 
  rectMode(CENTER); 
} 
 
void draw() 
{   
  background(51); 
  fill(255, 80); 
  rect(mouseX, height/2, mouseY/2+10, mouseY/2+10); 
  fill(255, 80); 
  rect(width-mouseX, height/2, ((height-mouseY)/2)+10, ((height-mouseY)/2)+10); 
} 
 
 







   
  Processing is an open project initiated by Ben Fry and Casey Reas  
  © Info  
> Casey Reas     © Info