xxxxxxxxxx
let st = 0;
let cw = 100;
let ch = 100;
let a1;
function setup() {
if(windowWidth>windowHeight){
ch = int(windowHeight*0.9);
cw = ch;
} else {
cw = int(windowWidth*0.9);
ch = cw;
}
a1 = createCanvas(cw, ch);
a1.parent("a1");
background(100);
$("body").keydown((e)=>{
if(e.key=='z'){
let fs = fullscreen();
if(!fs){
fullscreen(!fs);
}
}
});
}
function draw() {
if(mouseIsPressed){
line(mouseX, mouseY, pmouseX, pmouseY);
}
}
function windowResized() {
/* if(windowWidth>windowHeight){
ch = int(windowHeight*0.9);
cw = ch;
} else {
cw = int(windowWidth*0.9);
ch = cw;
}
resizeCanvas(cw, ch);
//a1 = createCanvas(cw, ch);
background(100);
*/
}