gamify Posted February 13, 2017 Share Posted February 13, 2017 I need to perform click and double click function on entity object is it possible in melonjs ?? Quote Link to comment Share on other sites More sharing options...
Parasyte Posted February 13, 2017 Share Posted February 13, 2017 Yes, it is possible. I assume your real question is how to implement double-click? You've probably noticed that melonJS only supports the PointerEvent spec, which itself does not specify gestures like double-click, pinch, or swipe. You can build your own by introducing a delay in the pointerup handler; set a timeout, then wait for one of the following events to occur: If a pointerdown event is received while waiting, this event needs to be promoted to a double-click event and triggered immediately. If the timeout expires first, trigger a single-click event immediately. The delay is configurable by the host operating system, it is usually about 300ms. We don't have any way of querying the UA to get any information about gesture settings. That said, I found the same question asked on the Babylon forum: Quote Link to comment Share on other sites More sharing options...
gamify Posted February 14, 2017 Author Share Posted February 14, 2017 ok fine i will try thank you so much to reply Quote Link to comment Share on other sites More sharing options...
obiot Posted February 14, 2017 Share Posted February 14, 2017 oh yeah that's a good question actually, i did not need it so far, but it's definitely a handy answer/info to have Quote Link to comment Share on other sites More sharing options...
gamify Posted February 21, 2017 Author Share Posted February 21, 2017 can ypu provide any example for double click and on single click draggable for sprite image Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.