Not sure how to use ccTouchesBegan to do what I want it to do.

Posted by thyrgle on Stack Overflow See other posts from Stack Overflow or by thyrgle
Published on 2010-05-16T17:42:58Z Indexed on 2010/05/16 17:50 UTC
Read the original article Hit count: 294

Filed under:
|

So when I see ccTouchesBegan (or touchesBegan for that fact of the matter) I see something like this usually:

- (void)ccTouchesBegan:(NSSet*)touches withEvent:(UIEvent*)event
{
   UITouch* touch = [touches anyObject];
}

But, what I am not getting is how do you just detect if one object has been touched? For example how would I check if a specific CCSprite I declared has been touched?

Sorry if this is a newbish question but, I just don't understand and if you need more clarification just ask how I can clarify myself more.

© Stack Overflow or respective owner

Related posts about cocos2d

Related posts about iphone