mirror of
https://github.com/wassname/phaser.git
synced 2026-10-04 12:50:39 +08:00
Input priority IDs working properly for drag events.
This commit is contained in:
1 parent
2270da2479
commit
b951b02de8
22 files changed
+418
-208
No files matched your search
+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