I’ve recently discovered two new pieces of software that make creating mobile applications easier, TexturePacker and PhysicsEditor. Today, I will be reviewing TexturePacker, which turns sprite images into a neatly compiled spritesheet with corresponding files for your platform of choice.
My platform of choice is Corona SDK, so I will be covering how to implement a Flash animation into that, but TexturePacker supports a wide variety of other platforms.
For this example, I drew a very basic animation in Adobe Flash CS6. You can use any animation software you’re comfortable with, but I chose Flash because I’ve been using it since Macromedia Flash 5. In the Flash library, I converted my animated graphic symbol into a .png sequence and named it “guy”. This nine-frame animation was exported by Flash as “guy0001.png,”, “guy0002.png”, etc.
My next step was to open TexturePacker and import my newly-created sprites. I chose Corona TM SDK as my Data Format, decided where I wanted to save my Data File, and clicked Publish. That’s all I had to do on my end, which is the beauty of TexturePacker. It assembled my individual frames into a single spritesheet, and published a “guy.lua” file for me, which contains all of the data needed by Corona.
I then opened TextMate and created a new “main.lua” file. I inserted some very basic Lua coding to import the sprite, position him on screen and play the animation. Just for fun, I later added some physics to him to make him bounce up and down (physics coding not pictured below).
The final step was to open the main.lua file in CoronaSDK and there was my little orange guy bouncing up and down, waving, blinking and moving his mouth.
Overall, my experience with TexturePacker was great. It’s easy to use, versatile, free to try, and extremely affordable. This is probably going to be my go-to software of choice for compiling spritesheets. Also, when you decide to download TexturePacker, give PhysicsEditor a shot as well. PhysicsEditor really impressed me and I will be reviewing it next.
Here are the source files, feel free to modify them: Texture Packer Source Files