xxxxxxxxxx
28
let x = 2000;
let y = 100;
let capture;
function setup() {
createCanvas(x, y);
capture = createCapture(VIDEO);
capture.hide();
}
function draw() {
background(220);
image(capture, 0, 0, width, height); //width, width * capture.height / capture.width);
}
function mousePressed(){
if (y > 999){
y = 100;
x = 2000;
console.log(y);
}
else if (y < 101){
y = 5000;
x = 100;
console.log(y);
}
resizeCanvas(x, y)
}