mirror of
https://github.com/wassname/phaser.git
synced 2026-08-16 11:25:21 +08:00
Input priority IDs working properly for drag events.
This commit is contained in:
+13
-5
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user