Intersection of touch functions

Hello! I have a question. Is it possible to somehow make the touch functions not intersect with each other, also with the scroll? I just made two objects stuck on top of each other, located in the scroll, and all functions react to the touch at once, and not just one. How can this be fixed? Please tell me!

The touch function for the topmost object will fire first, followed by the function for the object directly under it, and so on. To stop the touch event propogating like this you just need to return true in whichever function you would like it to stop at (presumably the first one).

You mean this is inside a scrollview?

If it is so,
the best solution is to handle the focus like this:
https://docs.coronalabs.com/api/type/ScrollViewWidget/takeFocus.html

And remember to return true.

In short, this prevent touch when scrolling and it stops propagating it.

Ok, thanks!

Good, thanks!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.