Making drag and swipe over collision box that is used as trigger for changing screen?

How I can make this spots in center of globe(different levels) to open level screen on tapping. But also able to drag/swipe over spot button area for handling rotation of globe menu without triggering to changing level screen.

I don’t understand the question. Could you please elaborate a bit on what you want?

My interpretation is: “How do I differentiate input intended for dragging the world as opposed to tapping to enter a level?”

I would track the time between press and release, if it is long then the user intended to drag. If it is short, the user intended to tap.

On press:
Start a counter

While pressed:
Do dragging

On release:
If the time between press and release is short, trigger a level (if release was on the level)

1 Like

Yes, Same thing as @Alex_8BitSkull eloborated. I will try as he suggested.

1 Like

I would do one of these:

  1. Track position of pressed event. Track position of released event. If the distance between the two are larger than say 20px then it’s a drag.
  2. Track position of pressed event. Continuously track position of mouse/touch event. Calculate distance between pressed event and current event. If the distance goes above 20px set a dragging = true flag. When you get a released event you check if dragging is true or false and treat the released event accordingly.

Yes, Applied the same tracking position(first one). Made it work. By this way it work with swipe gesture also.

1 Like