35
« on: February 03, 2012, 09:19:29 pm »
One texture is better
I think a tool which packs them, and prints our an xml with the frames. I read this into sections..
animations, and their frames. and single images.
that way I can pack all the anims for a "character" in to one image... Then with that image, I can load and split it into animations which have their set frames, .ie....run, jump, walk...etc....Then I can select which animation I want to run.
I didnt inherit, but I havent used it for more than loading and parsing, testing at the moment..
Hope this helps, though I am terrible at explaining.
<?xml version="1.0" encoding="utf-8" ?>
<sprite src="character.png">
<animnation name="down" loop="true">
<frame name="down_1" x ="0" y="0" w="16" h="32"/>
<frame name="down_2" x ="17" y="0" w="16" h="32"/>
<frame name="down_3" x ="34" y="0" w="16" h="32"/>
<frame name="down_4" x ="51" y="0" w="16" h="32"/>
</animnation>
<animnation name="left" loop="true">
<frame name="left_1" x ="68" y="0" w="16" h="32"/>
<frame name="left_2" x ="85" y="0" w="16" h="32"/>
<frame name="left_3" x ="0" y="33" w="16" h="32"/>
<frame name="left_4" x ="17" y="33" w="16" h="32"/>
</animnation>
<animnation name="right" loop="true">
<frame name="right_1" x ="0" y="66" w="16" h="32"/>
<frame name="right_2" x ="34" y="33" w="16" h="32"/>
<frame name="right_3" x ="17" y="66" w="16" h="32"/>
<frame name="right_4" x ="51" y="33" w="16" h="32"/>
</animnation>
<animnation name="up" loop="true">
<frame name="up_1" x ="34" y="66" w="16" h="32"/>
<frame name="up_2" x ="68" y="33" w="16" h="32"/>
<frame name="up_3" x ="51" y="66" w="16" h="32"/>
<frame name="up_4" x ="85" y="33" w="16" h="32"/>
</animnation>
<image name="head" x ="68" y="66" w="16" h="16"/>
</sprite>