xxxxxxxxxx
25
function setup() {
createCanvas(400, 400);
}
//button callback example
var hit = false;
function setup() {
createCanvas(400,400);
background("#EEEEEE");
}
function draw(){
noStroke();
rect(100,200,100,100);
hit = collidePointRect(mouseX,mouseY,100,200,100,100); //see if the mouse is in the rect
if(hit){ //change color!
fill('Tomato')
}else{
fill('orange')
}
}