Created
July 17, 2012 13:39
-
-
Save talentless/3129443 to your computer and use it in GitHub Desktop.
sprite + particle example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface SparkleSprite : CCSprite { | |
CCParticleSystemQuad * fairyDustTail_; | |
} | |
// you can either use a setter (or a property) | |
-(void) setFairyDustTail: (CCParticleSystemQuad*)fairDustTail; | |
// or you can create it internally, but in this case you need to call this method after | |
// the node has already been added to its parent so you can do: | |
// [self.parent addChild:fairDustTail_] | |
-(void) addFairyDustTail; | |
@end | |
@implementation SparkleSprite | |
-(void)setPosition:(CGPoint)position { | |
fairyDustTail_.position = position; | |
[super setPosition:position]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment