xxxxxxxxxx
22
function setup() {
createCanvas(600, 400);
}
function draw() {
background(220);
//red fill and noStroke
fill(255, 0, 0);
noStroke();
print(mouseX);
if (mouseX > width / 3 * 2) {
rect(width / 3 * 2, 0, width / 3, height);
} else if (mouseX > width / 3) {
rect(width / 3, 0, width / 3, height);
} else if (mouseX > 0 && mouseX < width / 3) {
rect(0, 0, width / 3, height);
}
}