Skip to content

Instantly share code, notes, and snippets.

@talentless
Created July 17, 2012 13:39
Show Gist options
  • Save talentless/3129443 to your computer and use it in GitHub Desktop.
Save talentless/3129443 to your computer and use it in GitHub Desktop.
sprite + particle example
@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