alptugan
8/28/2018 - 8:53 AM

Zoom with HammerJS

this.hammer = new Hammer.Manager(this.canvas);
const pinch = new Hammer.Pinch();
this.hammer.add([pinch]);
this.hammer.on('pinchmove', (event) => {
  mainCamera.zoom = (mainCamera.zoom * 0.9 + mainCamera.zoom * event.scale * 0.1);
});