ImpactJS - TextureAtlas plugin
So as I mentioned in my previous post I am using CocoonJS as a canvas wrapper on mobile devices for my upcoming game. Because CocoonJS uses opengl to render the game I have to convert all my image dimensions to a power of 2.
The neat thing is that I have been using TexturePacker to merge the frames for each animation into a single image and TexturePacker can automatically output the resulting image in a power of 2 dimension.
The problem comes in with the way ImpactJS handles animations. Basically you need a single image for each animation and each frame has to be the same size. Now when I have converted all my animation images to a power of 2, there is alot of blank space being wasted.
My solution was to write a TextureAtlas + TextureAtlasAnimation plugin for ImpactJS that reads in a JSON array from the output of TexturePacker allowing me to put as many images as reasonable into one big image and then reference the frames by name. No longer will I need to separate different animations into separate images.
I have made the plugin available with a demo on Github HERE. Just a warning that version 0.1 does not support drawing angled animations, I will implement this soon :)













