Skip to content

BenoitFreslon/AnimatedSprite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

#AnimatedSprite

By Benoît Freslon: http://www.benoitfreslon.com

Please send me feebacks ;).

##About Handle your animations with your spritesheets atlases with cocos2d-iphone 2.0. A simple class with simple methods: init, start, stop, restart, ...

The swf animations are converted and exported with TexturePacker for cocos2d-iphone 2.0.

See a tutorial example here: Tutorial: Export your Flash animations on iPhone/iPad with cocos2D and TexturePacker

##Requierements

##Get started

  • Include the AnimatedSprite.m and the AnimatedSprite.h into your XCode project.
  • Add a compiler flag "-fobjc-arc" in XCode on AnimatedSprite.m.

##Usage

// Create the pig instance with a default sprite image
AnimatedSprite *pig = [AnimatedSprite spriteWithSpriteFrameName:@"pig_walk.swf/0000"];
        
// Init a looping animation
[pig addLoopingAnimation:@"walk" frame:@"pig_walk.swf/%04d" delay:0.05f];
        
// Init an animation
[pig addAnimation:@"dead" frame:@"pig_dead.swf/%04d" delay:0.05f target:self callback:@selector(removePig)];
        
// Add the sprite in the scene
[self addChild:pig];
        
// Start the walk animation
[pig startAnimation:@"walk"];

##Help See comments in AnimatedSprite.h

About

AnimatedSprite class for Cocos2D and TexturePaker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published