xxxxxxxxxx
27
function setup() {
createCanvas(400, 400);
background(220);
}
function draw() {
let clearDrawing = ellipse(20, 20, 20, 20);
textAlign(CENTER);
textSize(10);
text("X", 20, 23);
}
function mouseDragged() {
line(mouseX, mouseY, pmouseX, pmouseY);
// prevent default
return false;
}
function mousePressed() {
let mx = mouseX;
let my = mouseY;
if ((mx > 20 && mx < 40) && (my > 20 && my < 40)) {
background(220);
}
}