Last active
December 17, 2015 08:49
-
-
Save dabing1022/5582404 to your computer and use it in GitHub Desktop.
CCAnimationAbout
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
NSMutableArray *frames = [NSMutableArray arrayWithCapacity:4]; | |
for(int i = 0; i < 4; i++){ | |
CCSpriteFrame *frame = [[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:[NSString stringWithFormat:@"lampMenuAni%d.png",i]]; | |
[frames addObject:frame]; | |
} | |
CCAnimation *myAnimation = [CCAnimation animationWithSpriteFrames:frames delay:0.15f]; | |
id animate = [CCAnimate actionWithAnimation:myAnimation]; | |
id repeat = [CCRepeatForever actionWithAction:animate]; | |
[sprite runAction:repeat]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment