Areg Posted May 22, 2014 Share Posted May 22, 2014 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 ). 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 More sharing options...
lokhmakov Posted May 22, 2014 Share Posted May 22, 2014 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 More sharing options...
Recommended Posts