Reputation: 587
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?
Upvotes: 1
Views: 1601
Reputation: 587
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.
Upvotes: 1
Reputation: 1517
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..
Upvotes: 0