Jump to content

How to access double-click event


Areg
 Share

Recommended Posts

I have a sprite and want to know when it is double clicked. As far as I know, there is  no such built-in event/signal in Phaser(great framework, btw :D).  Is there any way to check if sprite has been double-clicked?  I know about the doubleTapRate property, but I'm not sure how to use it. How to check if the last click has been clicked within the given doubleTapRate?

Link to comment
Share on other sites

1. I realize double click in such method:

        isDoubleClick(oPointer: Phaser.Pointer) : boolean {            if (oPointer.justReleased(20)) {                var now = new Date().getTime();                var timesince = now - this.dClickLast;                if((timesince < 300) && (timesince > 0)) {                    return true;                }                this.dClickLast = new Date().getTime();            }            return false;        }

2. But it's work strange on different situation. I will do a new version when the inspiration will come

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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