Closed oldmanvegas closed 10 years ago
Well - I may be wrong - but this fix seems to work. By placing
layer.render();
in an EnterFrame Event - the clip animates and any static sprites rotate etc as intended. I'm pretty sure this isn't mentioned ANYWHERE in the documentation on how to implement this library. But after lots of wasted hours I now have an animated sprite from a Texture Packer spritesheet. Way to go me. Thanks.
After adding the tilelayer library to my project I have been trying to animate a spritesheet - the sprites are called in from a Sparrow spritesheet correctly - but not animating. I ran an on EnterFrame test to alter the rotation value (add 1 every frame) to check everything was working correctly but that also makes no difference to the sprite either. Everything is compiling properly and launching to HTML5 & Flash, but not animating. Tracing out the TileClip's rotation property shows the correct values (it goes up as expected) but the clip itself is static.
I've traced the clip.frames.length and it shows the full amount of frames but sticks on currentFrame being 0.
Am I missing something? I have called the clip.play() but nothing happens.
Code Example: // animated tile
XML: (removed enclosing brackets to make the content display here) SubTexture name="Campy_SwimIdle_00000" x="2" y="86" width="204" height="56" frameX="-13" frameY="-5" frameWidth="234" frameHeight="68" ( ...and so on till...) SubTexture name="Campy_SwimIdle_00011" x="416" y="96" width="200" height="54" frameX="-16" frameY="-7" frameWidth="234" frameHeight="68"