From 013852d456b865ab754b4395a18029fb1650e3ad Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Fri, 29 Sep 2017 06:26:40 +0200 Subject: [PATCH] touch event fire properly for start --- src/game-lib-system-input.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/game-lib-system-input.js b/src/game-lib-system-input.js index 51185a7..5cb2c5b 100644 --- a/src/game-lib-system-input.js +++ b/src/game-lib-system-input.js @@ -225,11 +225,12 @@ GameLib.System.Input.prototype.onTouchStart = function(event) { pageX : event.touches[t].pageX, pageY : event.touches[t].pageY, cancelled : false, - ended : false, - event : event + ended : false }; } + this.touches.event = event; + GameLib.Event.Emit( GameLib.Event.TOUCH_START, this.touches @@ -269,9 +270,10 @@ GameLib.System.Input.prototype.onTouchMove = function(event) { this.touches[id].down += down; this.touches[id].pageX = event.changedTouches[t].pageX; this.touches[id].pageY = event.changedTouches[t].pageY; - this.touches.event = event; } + this.touches.event = event; + GameLib.Event.Emit( GameLib.Event.TOUCH_MOVE, this.touches