Mouse Press
Move the mouse to position the shape. Press the mouse button to invert the color.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function setup() {
createCanvas(720, 400);
background(230);
strokeWeight(2);
}
function draw() {
if (mouseIsPressed) {
stroke(255);
} else {
stroke(237, 34, 93);
}
line(mouseX - 66, mouseY, mouseX + 66, mouseY);
line(mouseX, mouseY - 66, mouseX, mouseY + 66);
}