xxxxxxxxxx
22
// Clicking in the box toggles fullscreen on and off.
function setup() {
createCanvas(windowWidth, windowHeight);
background(0);
}
function mousePressed() {
if (mouseX > 0 && mouseX < windowWidth && mouseY > 0 && mouseY < windowHeight) {
let fs = fullscreen();
fullscreen(!fs);
}
}
function draw() {
fill(255);
circle(width/2, height/2, height/2);
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
}