// CS3451 Computer Graphics // P0 - MyMouse2D // Catherine Hrrington // http://www-static.cc.gatech.edu/grads/c/catyarr/ // Created on May 18, 2006 // Mouse 2D // by REAS // Moving the mouse changes the position and size of each box. // Updated 21 August 2002 void setup() //Executed at initialization { size(100, 200); //Size of screen in pixels // noStroke(); //Draws border around shapes colorMode(RGB, 255, 255, 255, 100);//Set maximum R, G, B, and Opacity rectMode(CENTER); //Sets the first two params of rect to specify the center } void draw() //Executed continuously to refresh window { background(0); //Sets black background fill(255, 100,100,100); //Fills solid red rect(mouseX, height/2, mouseY/2+10, mouseY/2+10);//Draws rectangle fill(100,155,100,50); //Fills slightly transparent green ellipse(width-mouseX, height/3, ((height-mouseY)/2)+10, ((height-mouseY)/2)+10); //Draws circle }