xxxxxxxxxx
var checkbox; // this is the a DOM element
var c = false;
function setup() {
createCanvas(windowWidth, windowHeight);
checkbox = createCheckbox('circles?', false); // where does it go
checkbox.position(50, 50); // move it where you want it
let box = checkbox.elt.getElementsByTagName('input')[0];
box.style.width = '50px';
box.style.height = '50px';
checkbox.style('font-size', '50px');
checkbox.changed(checkme);
}
function draw() {
background(255);
fill(0, 0, 255);
if(c)
{
ellipse(random(width), random(height), random(50), random(50));
}
else {
rect(random(width), random(height), random(50), random(50));
}
}
function checkme()
{
c = this.checked();
}