Last week, I did a lot of programmings to handle animations in the game. I have created two tools one for the generating the tileset and the XML data of the animation. I had a hard time to make a good algorithm bin packing, so I have decided to not waste time on that and use one that is already implemented:
https://github.com/juj/RectangleBinPack
An example of a sprite packing on 2048×2048 texture.
And the code for one animation:
<a n="anim1"> <f f="prison-cell-kitchen-no-door" t="80" x="300" y="300" tx="0" ty="1080" tw="51" th="498"/> <f f="prison-cell-kitchen-no-door" t="80" x="300" y="300" tx="1920" ty="0" tw="51" th="498"/> <f f="prison-cell-kitchen-no-door" t="80" x="300" y="300" tx="51" ty="1080" tw="51" th="498"/> <f f="prison-cell-kitchen-no-door" t="80" x="300" y="300" tx="1920" ty="498" tw="51" th="498"/> <f f="prison-cell-kitchen-no-door" t="80" x="300" y="300" tx="1971" ty="0" tw="51" th="498"/> <f f="prison-cell-kitchen-no-door" t="80" x="300" y="300" tx="102" ty="1080" tw="51" th="498"/> <f f="prison-cell-kitchen-no-door" t="80" x="300" y="300" tx="1971" ty="498" tw="51" th="498"/> <f f="prison-cell-kitchen-no-door" t="80" x="300" y="300" tx="153" ty="1080" tw="51" th="498"/> <f f="prison-cell-kitchen-no-door" t="80" x="300" y="300" tx="204" ty="1080" tw="51" th="498"/> <f f="prison-cell-kitchen-no-door" t="80" x="300" y="300" tx="255" ty="1080" tw="51" th="498"/> <f f="prison-cell-kitchen-no-door" t="80" x="300" y="300" tx="306" ty="1080" tw="51" th="498"/> <f f="prison-cell-kitchen-no-door" t="80" x="300" y="300" tx="357" ty="1080" tw="51" th="498"/> </a>
Once the animation is generated I need to edit the position and the timing of each frame, so I needed to create a tool to simulate and edit the animation.
I really like your writing style, excellent info , thanks for posting : D.
Useful information. Lucky me I found your site by chance, and I am surprised why this accident didn’t happened in advance! I bookmarked it.