Simple Draw
Draw a circle by left-clicking. Erase by right-clicking. Clear the screen with a middle click.Code
void setup() {
size(200,200);
background(0);
}
void draw() {
if (mousePressed) {
if (mouseButton == LEFT) {
stroke(255);
fill(128);
ellipse(mouseX,mouseY,20,20);
} else if (mouseButton == RIGHT) {
stroke(0);
fill(0);
ellipse(mouseX,mouseY,20,20);
} else if (mouseButton == CENTER) {
background(0);
}
}
}