Skip to content

Instantly share code, notes, and snippets.

@sdabet
Last active December 15, 2015 07:59
Show Gist options
  • Save sdabet/5227307 to your computer and use it in GitHub Desktop.
Save sdabet/5227307 to your computer and use it in GitHub Desktop.
CCLayer touch configuration
@implementation MyLayer
-(id) init {
if(self = [super init]) {
self.touchMode = kCCTouchesOneByOne;
self.touchEnabled = YES;
}
return self;
}
-(BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event {
// touch down
}
-(void) ccTouchMoved:(UITouch *)touch withEvent:(UIEvent *)event {
// touch moved
}
-(void) ccTouchEnded:(UITouch *)touch withEvent:(UIEvent *)event {
// touch up
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment