0

can you assist me?

https://konvajs.github.io/docs/sandbox/Multi-touch_Scale_Stage.html

this tutorial works perfectly, can you help me please make the rotation in same manner? i want to rotate my stage clockwise and counterclockwise.

Maks
  • 1

1 Answers1

0

This simplest way is to add gesture recognition library and then use rotate event.

For example, I added https://zingchart.github.io/zingtouch/ library.

var containerElement = document.getElementById('container');
var activeRegion = ZingTouch.Region(containerElement);

var childElement = document.getElementById('container');
activeRegion.bind(childElement, 'rotate', function(event){
    stage.rotation(-event.detail.angle);
    stage.draw();
});

Demo: https://jsfiddle.net/lavrton/7nLte356/9/

lavrton
  • 18,973
  • 4
  • 30
  • 63
  • thank you, but just checked your example on ipad/iphone - black square just dragging, no rotation – Maks Jun 10 '17 at 10:06