Reputation: 2287
Trying to implement a modal window with CCLayer. My modal view layer is added as a child of another layer.
On my modal view layer I've added methods(the touch is enabled):
-(void) registerWithTouchDispatcher
{
[[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:0 swallowsTouches:YES];
}
-(BOOL) ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event
{
return YES;
}
Why the modal view layer it doesn't swallos my touches?
Upvotes: 2
Views: 660
Reputation: 318
try to set priority to -129. Menu have lowest priority (kCCMenuTouchPriority = -128). Just try this code:
[[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:-129 swallowsTouches:YES];
Upvotes: 2