views:

151

answers:

1

Hi , I have created a layer for a demo game application using cocos2D Framework. I have integrating cocos2d with existing application. I need to detect Touch Events for that. But I am not able to Detect that.I have used ccTouchesBegan.

  • (BOOL)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [self ccTouchesEnded:touches withEvent:event]; }

Even simple touchBegan event is also not fired.

do I have to add anything like delegate or Protocol for that ? I am new in iphone development and also I am learning cocos2d programming for game development . please help.

+1  A: 

In the init method of the layer, you need to tell it to respond to touches by setting self.isTouchEnabled = YES;.

Colin Gislason
Thanks Buddy , its working
BK