From 2633f8ce6d2bdfa5c4746156870b0db6e83ba74c Mon Sep 17 00:00:00 2001 From: photonstorm Date: Tue, 22 Sep 2015 13:53:19 +0100 Subject: [PATCH] InputHandler.validForInput now checks if the game object has `input.enabled` set to `false` and doesn't validate it for input if that's the case. --- README.md | 1 + src/input/InputHandler.js | 2 +- src/input/Pointer.js | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 782463049..6cdca1351 100644 --- a/README.md +++ b/README.md @@ -288,6 +288,7 @@ If you are an exceptional JavaScript developer and would like to join the Phaser * The Physics Editor Exporter (found in the resources folder of the repo) has had an option to prefix shape names and optimize JSON output added to it (thanks @Garbanas #2093) * Touch.addTouchLockCallback has a new argument `onEnd` which allows the callback to fire either on a touchstart or a touchend event. * The SoundManager now detects if the browser is running under iOS9 and uses a touchend callback to unlock the audio subsystem. Previous versions of iOS (and Android) still use touchstart. This fixes Apple's screw-up with regard to changing the way Web Audio should be triggered in Mobile Safari. Thanks Apple (thanks @MyCatCarlos for the heads-up #2095) +* InputHandler.validForInput now checks if the game object has `input.enabled` set to `false` and doesn't validate it for input if that's the case. ### Bug Fixes diff --git a/src/input/InputHandler.js b/src/input/InputHandler.js index ac4e2961e..9da332a31 100644 --- a/src/input/InputHandler.js +++ b/src/input/InputHandler.js @@ -438,7 +438,7 @@ Phaser.InputHandler.prototype = { if (includePixelPerfect === undefined) { includePixelPerfect = true; } - if (this.sprite.scale.x === 0 || this.sprite.scale.y === 0 || this.priorityID < this.game.input.minPriorityID) + if (!this.enabled || this.sprite.scale.x === 0 || this.sprite.scale.y === 0 || this.priorityID < this.game.input.minPriorityID) { return false; } diff --git a/src/input/Pointer.js b/src/input/Pointer.js index 8cf6e7dfa..ffced121a 100644 --- a/src/input/Pointer.js +++ b/src/input/Pointer.js @@ -833,7 +833,7 @@ Phaser.Pointer.prototype = { var currentNode = this.game.input.interactiveItems.first; - while(currentNode) + while (currentNode) { if (!currentNode.checked && currentNode.validForInput(highestInputPriorityID, highestRenderOrderID, true))