Input priority IDs working properly for drag events.

This commit is contained in:
Richard Davey
2013-06-03 01:22:14 +01:00
parent 2270da2479
commit b951b02de8
22 changed files with 418 additions and 208 deletions
+13 -5
View File
@@ -252,8 +252,6 @@ module Phaser {
}
// Sprite Drag Related
/**
* The Game Object this Pointer is currently dragging.
* @property draggedObject
@@ -369,15 +367,15 @@ module Phaser {
{
if (this.game.input.inputObjects[i].input.enabled)
{
this.game.input.inputObjects[i].input.update(this);
if (this.game.input.inputObjects[i].input.priorityID > _highestPriority)
if (this.game.input.inputObjects[i].input.update(this) && this.game.input.inputObjects[i].input.priorityID > _highestPriority)
{
_highestPriority = this.game.input.inputObjects[i].input.priorityID;
}
}
}
//console.log('highest priority was', _highestPriority);
if (this.isDown)
{
// Now update all objects with the highest priority ID (can be more than 1)
@@ -493,6 +491,16 @@ module Phaser {
this.game.input.currentPointers--;
}
for (var i = 0; i < this.game.input.totalTrackedObjects; i++)
{
if (this.game.input.inputObjects[i].input.enabled)
{
this.game.input.inputObjects[i].input._releasedHandler(this);
}
}
this.draggedObject = null;
return this;
}