xxxxxxxxxx
35
// we want the user to be able to pinch zoom and read how and where theyre zoomin
// reading zoom levels appears to be different for all browsers (if possible at all)
// i thought it would be easier to disable browser zoom and instead hardcode
// a pinch zoom in p5
so far, it appears p5 can detect multiple simultaneous mouse/finger presses
but the problem is that it only reads the coordinates of one and i dont think
there is any way to access the coords of the others
let touch = 0;
let i;
function setup() {
createCanvas(400, 400);
textSize(20);
}
function draw() {
background(220);
for(i=0;i<touch;i++){
text(i,20,20+i*20);
}
text("X: " + mouseX,width-100, 20);
text("Y: " + mouseY,width-100, 40);
}
function mousePressed(){
touch++;
}
function mouseReleased(){
touch--;
}