showing results for - "javascript canvas touchmove"
Nohan
30 Apr 2016
1// on brouser
2var canv = document.getElementById('my_canvas');
3canv.addEventListener('mousemove', e => {
4    console.log({x:e.offsetX, y:e.offsetY, z:e})
5});
6
7// for mobile on touch
8var canv = document.getElementById('my_canvas');
9canv.addEventListener('touchmove', e => {
10    ee = e.touches[0];
11    console.log({x:ee.clientX, y:ee.clientY, z:e})
12});