From my understanding by using the ccTouches methods I get a NSSet object which holds all the touches. No I am having a hard time as I am getting confused thinking about this and what I am trying to achieve. Say I touched the screen, that would trigger a touch on ccTouchesBegan. Then say I moved that touch. How would I track that touch exactly? Like say I touch and move but during that move I make another touch and move. How do I track the first touch and move I made? I want to do a simple check like if Touch == touch1 or whatever then execute code.
Sorting and Tracking ccTouches
(2 posts) (2 voices)-
Posted 1 year ago #
-
Please look at CCTouchDelegateProtocol.h and CCTouchDispatcher.h in the source code.
Basically you will be doing something like
-(void)onEnter { [[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:0 swallowsTouches:YES]; [super onEnter]; } -(void)onExit { [[CCTouchDispatcher sharedDispatcher] removeDelegate:self]; [super onExit]; }Posted 1 year ago #
Reply
You must log in to post.