sketchDownload
function setup() {
createCanvas(200, 200);
background(220);
text("p5.js vers 0.9.0 test.", 10, 15);
}
function draw() {
background(204);
ellipse(50, 50, 80, 80);
}
sketchDownload
function setup() {
createCanvas(300, 300);
background(220);
// text("p5.js vers 0.9.0 test.", 10, 15);
}
function draw() {
if (mouseX < width / 2) { // left side
if (mouseY < height / 2) { // top half
background(255, 0, 0);
}
else { // bottom half
background(0, 255, 0);
}
}
else { // right side
if (mouseY < height / 2) { // top half
background(0, 0, 255);
}
else { // bottom half
background(0, 0, 0);
}
}
}