Jump to content

Manually call onInputDown for drag


Riddik
 Share

Recommended Posts

Hi!
I need to manually call the inputDown event for drag with dispatch input events, how can I do this?
 
Events added:
item.events.onInputDown.add(selectItem);item.events.onInputUp.add(releaseItem);
 
If do this:
item.events.onInputDown.dispatch(item, game.input.activePointer);item.input.startDrag(game.input.activePointer);

then events onInputUp don't dispatched. How can manually simulate inputDown to sprite?

Link to comment
Share on other sites

Update:

 

I did this:

item.update = itemDrag;function itemDrag(){    if(game.input.activePointer.isDown)    {        this.x = game.input.x;        this.y = game.input.y;            }    else releaseItem(this, game.input.activePointer);   }

Works fine)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...