stuff
This commit is contained in:
parent
8275c8decc
commit
0fb19d45ad
1 changed files with 11 additions and 0 deletions
11
js/core.js
11
js/core.js
|
@ -30,6 +30,10 @@ function Canvas(width, height, upscale) {
|
||||||
this.elem.addEventListener('mousedown', function (e) {
|
this.elem.addEventListener('mousedown', function (e) {
|
||||||
that.clicked = true;
|
that.clicked = true;
|
||||||
});
|
});
|
||||||
|
this.elem.addEventListener('touchstart', function (e) {
|
||||||
|
that.clicked = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
this.elem.addEventListener('touchmove', function (e) {
|
this.elem.addEventListener('touchmove', function (e) {
|
||||||
that.pageX = e.touches[0].pageX;
|
that.pageX = e.touches[0].pageX;
|
||||||
|
@ -60,6 +64,13 @@ function Canvas(width, height, upscale) {
|
||||||
that.firstY = this.pageY;
|
that.firstY = this.pageY;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.elem.addEventListener('touchend', function (e) {
|
||||||
|
that.clicked = false;
|
||||||
|
|
||||||
|
that.firstX = this.pageX;
|
||||||
|
that.firstY = this.pageY;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
this.clicked = false;
|
this.clicked = false;
|
||||||
this.pageX = 0;
|
this.pageX = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue