I know that there are a lot of posts about multi touch, and I've looked at all of them, but after trying many suggestion I still can't get it to work.
I am simply trying to get my main layer to register multiple touches.
This is what I have done:
I setMultipleTouchEnabled: in the appDelegate's applicationDidFinishLaunching: method.
EAGLView *glView = [EAGLView viewWithFrame:[window bounds]
pixelFormat:kEAGLColorFormatRGB565 // kEAGLColorFormatRGBA8
depthFormat:0 // GL_DEPTH_COMPONENT16_OES
];
[glView setMultipleTouchEnabled:YES];
// attach the openglView to the director
[director setOpenGLView:glView];
I put this in the layer that I want to register multiple touches:
- (void)onEnter {
[[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:0 swallowsTouches:YES];
[super onEnter];
}
- (void)onExit
{
[[CCTouchDispatcher sharedDispatcher] removeDelegate:self];
[super onExit];
}
I then used
- (BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event
and
- (void) ccTouchEnded:(UITouch *)touch withEvent:(UIEvent *)event
With this setup it registers one touch at a time, but the multiple touch just does not work.
I just can't see what I am missing. I have looked everywhere and I just can't see what I am doing wrong.
It just seems to me that it should work.