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.

This commit is contained in:
photonstorm 2015-09-22 13:53:19 +01:00
parent 9f08442304
commit 2633f8ce6d
3 changed files with 3 additions and 2 deletions

View file

@ -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

View file

@ -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;
}

View file

@ -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))