Inside the Header File:
[sourcecode language="objc"]
@interface CustomSprite : CCSprite <CCTargetedTouchDelegate>
[/sourcecode]
Inside the Implementation File:
[sourcecode language="objc"]
- (void) onEnterTransitionDidFinish
{
[[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:1 swallowsTouches:YES];
}
- (void) onExit
{
[[CCTouchDispatcher sharedDispatcher] removeDelegate:self];
}
[/sourcecode]
No comments:
Post a Comment