Hi,
i'm trying to detect touches in Cocos2D, my function within "resultScene" looks like this:
- (BOOL)ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
if( touch ) {
CGPoint location = [touch locationInView: [touch view]];
// IMPORTANT:
// The touches are always in "portrait" coordinates. You need to convert them to your current orientation
CGPoint convertedPoint = [[Director sharedDirector] convertToGL:location];
[[Director sharedDirector] runWithScene: [menuScene scene]];
NSLog(@"aaa");
// no other handlers will receive this event
return kEventHandled;
}
// we ignore the event. Other receivers will receive this event.
return kEventIgnored;
}
But if I touch the screen it doesn't even show "aaa" in the console. How do I fix this error?