Question

I'm trying to implement ccTouchesBegan in my GameScene.

I've set isTouchEnabled = YES. I'm also calling addStandardDelegate on the touchDispatcher. Finally, in my AppDelegate i have [glView setMultipleTouchEnabled:YES].

However, ccTouchesBegan is never called.

What am I doing wrong?

Was it helpful?

Solution

Solved it!

I was registering touches on a previous layer, but the layer wasn't being dealloced because you have to "un-register" with the onExit method.

Long story short: touchesBegan was not being called on my GameLayer because it was being swallowed by another layer.

OTHER TIPS

Create one dummy application and try this:

@protocol CCStandardTouchDelegate <NSObject>
@optional
- (void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)ccTouchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event;
@end

May be it will help you..

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top