From c7803e0cd29e621feff3613234f6a9c26667374a Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Thu, 28 Dec 2017 15:14:16 +0000 Subject: [PATCH] Debugging topOnly events --- v3/src/input/local/inc/ProcessDownEvents.js | 2 ++ v3/src/input/local/inc/ProcessOverOutEvents.js | 9 +++++++++ v3/src/input/mouse/MouseManager.js | 2 ++ v3/src/input/touch/TouchManager.js | 2 ++ 4 files changed, 15 insertions(+) diff --git a/v3/src/input/local/inc/ProcessDownEvents.js b/v3/src/input/local/inc/ProcessDownEvents.js index b43b3a61c..4d1998ec8 100644 --- a/v3/src/input/local/inc/ProcessDownEvents.js +++ b/v3/src/input/local/inc/ProcessDownEvents.js @@ -4,6 +4,8 @@ var ProcessDownEvents = function (pointer) { var currentlyOver = this._temp; + console.log('ProcessDownEvents', this.topOnly); + this.events.dispatch(new InputEvent.POINTER_DOWN(pointer, currentlyOver)); // Go through all objects the pointer was over and fire their events / callbacks diff --git a/v3/src/input/local/inc/ProcessOverOutEvents.js b/v3/src/input/local/inc/ProcessOverOutEvents.js index 8af5da52a..1d7f54974 100644 --- a/v3/src/input/local/inc/ProcessOverOutEvents.js +++ b/v3/src/input/local/inc/ProcessOverOutEvents.js @@ -11,6 +11,9 @@ var ProcessOverOutEvents = function (pointer) var stillOver = []; var previouslyOver = this._over[pointer.id]; + // TODO - in a topOnly situation a new justOver entry at the top + // should clear all previous justOut entries + // Go through all objects the pointer was previously over, and see if it still is for (i = 0; i < previouslyOver.length; i++) { @@ -46,6 +49,8 @@ var ProcessOverOutEvents = function (pointer) // Process the Just Out objects var total = justOut.length; + console.log('justOut', total); + if (total > 0) { this.sortGameObjects(justOut); @@ -68,6 +73,7 @@ var ProcessOverOutEvents = function (pointer) if (this.topOnly) { + console.log('break 1'); break; } } @@ -76,6 +82,8 @@ var ProcessOverOutEvents = function (pointer) // Process the Just Over objects total = justOver.length; + console.log('justOver', total); + if (total > 0) { this.sortGameObjects(justOver); @@ -98,6 +106,7 @@ var ProcessOverOutEvents = function (pointer) if (this.topOnly) { + console.log('break 2'); break; } } diff --git a/v3/src/input/mouse/MouseManager.js b/v3/src/input/mouse/MouseManager.js index d652f3889..9b5246ccc 100644 --- a/v3/src/input/mouse/MouseManager.js +++ b/v3/src/input/mouse/MouseManager.js @@ -130,6 +130,8 @@ var MouseManager = new Class({ return; } + // console.log('mouse', event); + queue.push(event); event.preventDefault(); diff --git a/v3/src/input/touch/TouchManager.js b/v3/src/input/touch/TouchManager.js index 4024d4edc..abfc68afa 100644 --- a/v3/src/input/touch/TouchManager.js +++ b/v3/src/input/touch/TouchManager.js @@ -61,6 +61,8 @@ var TouchManager = new Class({ return; } + // console.log('touch', event); + queue.push(event); event.preventDefault();