Hello,
I have a Layer subclass that registers itself to receive touches using this method:
-(void) registerWithTouchDispatcher
{
[[TouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:INT_MIN+1 swallowsTouches:YES];
}
and then I implement my cctouchbegan method as follow:
- (BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event
{
NSLog(@"Entered");
return YES;
}
I have noticed that no matter what I do this always gets called twice. I checked the cocos2d/menu.m and although it appears to do the same ccTouchBegan only gets called once.
Also I don't notice any difference between calling [self registerWithTouchDispatcher] or simply doing isTouchEnabled = YES. What is the difference between this two?. As I understand from posts I have found here the register is the new way to do it, but what does it do different exactly?
I am new to cocos2d and I have been reading posts about the new ways to handle touchs. Where can I find documentation regarding this?.
So why is this getting called twice?. Any help will be greatly appreciated.
Thank you.
-Oscar