add touchmove
This commit is contained in:
parent
da4f5afbe9
commit
8275c8decc
1 changed files with 38 additions and 33 deletions
|
@ -31,6 +31,11 @@ function Canvas(width, height, upscale) {
|
||||||
that.clicked = true;
|
that.clicked = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.elem.addEventListener('touchmove', function (e) {
|
||||||
|
that.pageX = e.touches[0].pageX;
|
||||||
|
that.pageY = e.touches[0].pageY;
|
||||||
|
})
|
||||||
|
|
||||||
this.elem.addEventListener('mousemove', function (e) {
|
this.elem.addEventListener('mousemove', function (e) {
|
||||||
that.pageX = e.pageX;
|
that.pageX = e.pageX;
|
||||||
that.pageY = e.pageY;
|
that.pageY = e.pageY;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue