touches t

beta.r3js.org
-=yb4f310 2017-11-18 14:22:25 +01:00
parent 78b29c7306
commit b4be255204
1 changed files with 8 additions and 8 deletions

View File

@ -617,27 +617,27 @@ GameLib.System.Input.prototype.onTouchMove = function (event) {
if (this.touches[id]) {
var diffX = Math.abs(this.touches[id].lastTouchX - event.changedTouches[id].pageX);
var diffY = Math.abs(this.touches[id].lastTouchY - event.changedTouches[id].pageY);
var diffX = Math.abs(this.touches[id].lastTouchX - event.changedTouches[t].pageX);
var diffY = Math.abs(this.touches[id].lastTouchY - event.changedTouches[t].pageY);
var left = 0;
var right = 0;
var up = 0;
var down = 0;
if (this.touches[id].lastTouchX < event.changedTouches[id].pageX) {
if (this.touches[id].lastTouchX < event.changedTouches[t].pageX) {
right += diffX;
}
if (this.touches[id].lastTouchX > event.changedTouches[id].pageX) {
if (this.touches[id].lastTouchX > event.changedTouches[t].pageX) {
left += diffX;
}
if (this.touches[id].lastTouchY > event.changedTouches[id].pageY) {
if (this.touches[id].lastTouchY > event.changedTouches[t].pageY) {
up += diffY;
}
if (this.touches[id].lastTouchY < event.changedTouches[id].pageY) {
if (this.touches[id].lastTouchY < event.changedTouches[t].pageY) {
down += diffY;
}
@ -645,8 +645,8 @@ GameLib.System.Input.prototype.onTouchMove = function (event) {
this.touches[id].left = left;
this.touches[id].up = up;
this.touches[id].down = down;
this.touches[id].lastTouchX = event.changedTouches[id].pageX;
this.touches[id].lastTouchY = event.changedTouches[id].pageY;
this.touches[id].lastTouchX = event.changedTouches[t].pageX;
this.touches[id].lastTouchY = event.changedTouches[t].pageY;
this.touches[id].pageX = event.changedTouches[t].pageX;
this.touches[id].pageY = event.changedTouches[t].pageY;
}