xxxxxxxxxx
38
var cam;
var video;
var A2 = false;
function Camera(x, y, r) {
let c = createVector();
this.render = function() {
push();
cam.filter(GRAY);
tint(random(255), random(255), random(255));
if (A2) {
translate(width / 2, height / 2);
image(cam, -125, -125, 250, 250);
} else {
translate(x + sposX, y);
image(cam, - r / 2, -r / 2, r, r);
}
pop();
}
}
function renderPicture(x, y, r) {
if (mouseX < x + r / 2 && mouseX > x - r / 2 &&
mouseY < y + r / 2 && mouseY > y - r / 2 &&
mouse) {
A2 = true;
text('YES!', 10, 10)
} else {
A2 = false;
}
//Frame
push();
translate(x + sposX, y);
square(-r / 2, -r / 2, r);
pop();
video.render();
}