xxxxxxxxxx
24
let btnRed;
function setup() {
createCanvas(400, 400);
background(220);
btnRed = createButton('red');
btnRed.position(0, 0);
// btnRed.mousePressed();
}
function clearScreen() {
fill(255);
circle(350, 350, 50);
if (mouseIsPressed && mouseX>=325 && mouseX<=375 && mouseY>=325 && mouseY<=375) {
background(220);
}
}
function draw() {
fill(0);
circle(mouseX, mouseY, 10);
clearScreen();
}