touches t
parent
78b29c7306
commit
b4be255204
|
@ -617,27 +617,27 @@ GameLib.System.Input.prototype.onTouchMove = function (event) {
|
||||||
|
|
||||||
if (this.touches[id]) {
|
if (this.touches[id]) {
|
||||||
|
|
||||||
var diffX = Math.abs(this.touches[id].lastTouchX - event.changedTouches[id].pageX);
|
var diffX = Math.abs(this.touches[id].lastTouchX - event.changedTouches[t].pageX);
|
||||||
var diffY = Math.abs(this.touches[id].lastTouchY - event.changedTouches[id].pageY);
|
var diffY = Math.abs(this.touches[id].lastTouchY - event.changedTouches[t].pageY);
|
||||||
|
|
||||||
var left = 0;
|
var left = 0;
|
||||||
var right = 0;
|
var right = 0;
|
||||||
var up = 0;
|
var up = 0;
|
||||||
var down = 0;
|
var down = 0;
|
||||||
|
|
||||||
if (this.touches[id].lastTouchX < event.changedTouches[id].pageX) {
|
if (this.touches[id].lastTouchX < event.changedTouches[t].pageX) {
|
||||||
right += diffX;
|
right += diffX;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.touches[id].lastTouchX > event.changedTouches[id].pageX) {
|
if (this.touches[id].lastTouchX > event.changedTouches[t].pageX) {
|
||||||
left += diffX;
|
left += diffX;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.touches[id].lastTouchY > event.changedTouches[id].pageY) {
|
if (this.touches[id].lastTouchY > event.changedTouches[t].pageY) {
|
||||||
up += diffY;
|
up += diffY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.touches[id].lastTouchY < event.changedTouches[id].pageY) {
|
if (this.touches[id].lastTouchY < event.changedTouches[t].pageY) {
|
||||||
down += diffY;
|
down += diffY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -645,8 +645,8 @@ GameLib.System.Input.prototype.onTouchMove = function (event) {
|
||||||
this.touches[id].left = left;
|
this.touches[id].left = left;
|
||||||
this.touches[id].up = up;
|
this.touches[id].up = up;
|
||||||
this.touches[id].down = down;
|
this.touches[id].down = down;
|
||||||
this.touches[id].lastTouchX = event.changedTouches[id].pageX;
|
this.touches[id].lastTouchX = event.changedTouches[t].pageX;
|
||||||
this.touches[id].lastTouchY = event.changedTouches[id].pageY;
|
this.touches[id].lastTouchY = event.changedTouches[t].pageY;
|
||||||
this.touches[id].pageX = event.changedTouches[t].pageX;
|
this.touches[id].pageX = event.changedTouches[t].pageX;
|
||||||
this.touches[id].pageY = event.changedTouches[t].pageY;
|
this.touches[id].pageY = event.changedTouches[t].pageY;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue