I need to track multiple touches, but I can't figure out how to do that. The new touch system seems to be the way to go, but I still don't know how to track multiple touches. For each ccTouchBegan I check if this is a touch that I want, if so I return YES. But in a multitouch situation, how do I know which touch is which later on, in ccTouchMoved and ccTouchEnded?
Tracking touches
(5 posts) (3 voices)-
Posted 2 years ago #
-
you will only receive the touch that you wanted (the one that you returned YES).
See the
tests/TouchesTest/to see how to use it.Posted 2 years ago # -
Yes, that I understand. But what if there are multiple simultaneous touches that I have returned YES on? How do I differentiate between them in the ccTouchMoved and ccTouchEnded.
Posted 2 years ago # -
dont use ccTouchMoved, use the ccTouches... methods and track them yourself.
Posted 2 years ago # -
But how do you track them? I thought of maybe retaining the touches, but the documentation states that you should not do that.
Posted 2 years ago #
Reply
You must log in to post.