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?
try to set priority to -129. Menu have lowest priority (kCCMenuTouchPriority = -128). Just try this code: