Hello, this is my first post in this forum, which so far has provided with an inmense amount of help! Great community!
I'm on .99.1.
Scenario:
I have a layer, and as a child of that layer I have a ccnode (it's in fact an instance of sneakyJoystick)
I had my joystick working fine and dandy as it was setup, however I also need to get touches from this parent layer which takes the whole screen, so I implemented the corresponding methods to have the layer comform to CCTargetedTouchDelegate the following way.
- (BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event {
NSLog(@"touch began");
return NO; //tried with yes as well here, but set it to NO so touch didn't get handled by this layer
}
- (void)ccTouchEnded:(UITouch *)touch withEvent:(UIEvent *)event
{
NSLog(@"toush");
CGPoint location = [[CCDirector sharedDirector] convertToGL:[touch locationInView:[touch view]]];
location = [self.map convertToNodeSpace:location];
NSLog(@"%f %f" ,location.x,location.y);
}
- (void) onEnterTransitionDidFinish
{
[[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:0 swallowsTouches:NO];
}
from then on my layer child (the joy) does not receive touches any longer, which leads me to believe that swallowsTouches is not being honored for this layer (or most likely I am missunderstanding something terribly wrong!).
Any pointers would be really helpful to see what is causing this behaviour.
Thanks a lot!