mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 15:12:18 +00:00
Callback result determines processing.
This commit is contained in:
parent
0ec5320e8d
commit
ba7e04ff77
1 changed files with 12 additions and 7 deletions
|
@ -1,15 +1,20 @@
|
|||
var ChildOnDown = function (pointer, interactiveObject)
|
||||
{
|
||||
interactiveObject.isDown = true;
|
||||
// If the callback returns false then we don't consider this child as interacted with
|
||||
var result = interactiveObject.onDown(interactiveObject.gameObject, pointer, interactiveObject.localX, interactiveObject.localY);
|
||||
|
||||
interactiveObject.onDown(interactiveObject.gameObject, pointer, interactiveObject.localX, interactiveObject.localY);
|
||||
if (result !== false)
|
||||
{
|
||||
interactiveObject.isDown = true;
|
||||
|
||||
this.children.down[pointer.id].push(interactiveObject);
|
||||
this.children.down[pointer.id].push(interactiveObject);
|
||||
|
||||
// if (input.draggable && !input.isDragged)
|
||||
// {
|
||||
// this.gameObjectOnDragStart(pointer, gameObject);
|
||||
// }
|
||||
if (interactiveObject.draggable && !interactiveObject.isDragged)
|
||||
{
|
||||
// Apply drag criteria here
|
||||
this.childOnDragStart(pointer, interactiveObject);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = ChildOnDown;
|
||||
|
|
Loading…
Reference in a new issue