xxxxxxxxxx
let wh, ofs, ctx, c, tf;
function setup() {
frameRate(10);
wh = min(windowWidth, windowHeight);
createCanvas(wh, wh);
//noLoop();
ctx = canvas.getContext('2d');
tf = false;
}
function draw() {
if((millis()|0)%2==0){
background(tf?'black':'white')
}
for(let x = 0; x < wh; x+=10){
for(let y = 0; y < wh; y+=10){
fill(tf?'white':'black')
text(x+y, x, y);
}
}
ctx.drawImage(document.getElementsByTagName('canvas')[0], random(cos(millis())*wh), random(sin(millis())*wh))
}
function mouseClicked() {
tf = tf?false:true;
}