Files
processing4/java/examples/Basics/Input/MousePress/MousePress.pde
benfry eb64b2d4fc
2011-01-26 19:22:19 +00:00

24 lines
360 B
Plaintext

/**
* Click.
*
* Move the mouse to position the shape.
* Press the mouse button to invert the color.
*/
void setup() {
size(200, 200);
fill(126);
background(102);
}
void draw() {
if(mousePressed) {
stroke(255);
} else {
stroke(0);
}
line(mouseX-66, mouseY, mouseX+66, mouseY);
line(mouseX, mouseY-66, mouseX, mouseY+66);
}