As per Request here is some more code: This is from the init of my gameplaylayer.
self.isTouchEnabled = YES;
[knight setJoystick:leftJoystick];
[knight setJoystickRight:attackButton];
And also from the gameplaylayer method:
-(void)initJoystickAndButtons {
CGSize screenSize = [CCDirector sharedDirector].winSize;
CGRect joystickBaseDimensions = CGRectMake(0, 0, 128.0f, 128.0f);
CGRect attackButtonDimensions = CGRectMake(0, 0, 128.0f, 128.0f);
CGPoint joystickBasePosition;
CGPoint attackButtonPosition;
joystickBasePosition = ccp(screenSize.width*0.10f,
screenSize.height*0.15f);
attackButtonPosition = ccp(screenSize.width*0.9f,
screenSize.height*0.15f);
SneakyJoystickSkinnedBase *joystickBase =
[[[SneakyJoystickSkinnedBase alloc] init] autorelease];
joystickBase.position = joystickBasePosition;
joystickBase.backgroundSprite =
[CCSprite spriteWithFile:@"dpadDown.png"];
joystickBase.thumbSprite =
[CCSprite spriteWithFile:@"joystickDown.png"];
joystickBase.joystick = [[SneakyJoystick alloc]
initWithRect:joystickBaseDimensions];
leftJoystick = [joystickBase.joystick retain];
[self addChild:joystickBase];
SneakyJoystickSkinnedBase *attackButtonBase = [[[SneakyJoystickSkinnedBase
alloc] init] autorelease];
attackButtonBase.position = attackButtonPosition;
attackButtonBase.backgroundSprite = [CCSprite spriteWithFile:
@"dpadDown.png"];
attackButtonBase.thumbSprite = [CCSprite
spriteWithFile:@"joystickDown.png"];
attackButtonBase.joystick = [[SneakyJoystick alloc] initWithRect:
attackButtonDimensions];
attackButton = [joystickBase.joystick retain];
[self addChild:attackButtonBase];
}
And I added this in the appdelegate
glView.multipleTouchEnabled = YES;