xxxxxxxxxx
41
var see = 0
var transp
function setup() {
createCanvas(400, 400);
button = createButton('Show hint');
button.position(272, 30);
button.mousePressed(seee)
//shows hint
}
function seee(){
see++
//sets transparency of rectangle to 0
}
function rectngle(){
noStroke()
fill(0, 0, 255, transp)
rect(100, 0, 50, 15)
fill(0)
//creates rectangle over hint text box
}
function draw() {
background(220);
rectngle()
if (see <= 0){
transp = 255
rectngle()
}
else if (see >= 1){
transp = 0
rectngle()
}
}