
Untitled
By: a guest on
Apr 25th, 2012 | syntax:
None | size: 0.51 KB | hits: 6 | expires: Never
int startx, starty;
int endx, endy;
void setup(){
size(400,400);
background(255);
smooth();
}
void draw(){
}
void mousePressed() {
startx = mouseX;
starty = mouseY;
}
void mouseDragged(){
background(255);
noFill();
ellipseMode(CENTER);
endx = mouseX;
endy = mouseY;
rectMode(CENTER);
rect(startx,starty,endx,endy);
fill(127);
ellipse(startx,starty,endx,endy);
}
void mouseReleased(){
background(255);
fill(127);
ellipse(startx,starty,endx,endy);
}