Skip to content

Instantly share code, notes, and snippets.

@zaneclaes
Created October 27, 2013 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zaneclaes/7184984 to your computer and use it in GitHub Desktop.
Save zaneclaes/7184984 to your computer and use it in GitHub Desktop.
@interface AMSprite ()
@property (nonatomic, strong) CCSprite *shadowSprite;
@end
@implementation AMSprite
- (void)addShadow {
if(self.shadowSprite) {
return;
}
self.shadowSprite = [CCSprite spriteWithSpriteFrame:self.displayFrame];
[self.shadowSprite setOpacity:255 / 4];
[self.shadowSprite setColor:ccBLACK];
self.shadowSprite.anchorPoint = ccp(0, 0);
self.shadowSprite.scaleY = 0.5;
self.shadowSprite.position = ccp( 0, 10);
[self addChild:self.shadowSprite z:-1];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment