Jump to content

Get when pointer is pressed/released.


sout7
 Share

Recommended Posts

Hello!

I want to capture when exactly a pointer is pressed and released (when its isUp and isDown change values). I also want to get the id of the pointer.

I tried with the start() and stop() methods of the pointer, but for some reason they need a DOM event as a parameter, which in my situation is completely useless, I think. Why can't I pass my own function, so that those methods can call it...

EDIT: I tried to use game.input.onDown() and game.input.onUp() and then loop through game.input.pointers to see which pointer is pressed/released. However, the engine is silly again... The onDown event is dispatched after isUp and isDown are changed, but onUp is dispatched before they are changed. I don't see any logic in this. It's kind of OK now, but I see a pointer as released only after another pointer is released. And I get when that other pointer is released when a third one gets released. It's ridiculous.

In version 2.4.2 (an older version - before 2.4.4, which I'm using), the onUp event is dispatched correctly, which is even more interesting.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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