How to get animation between frame 10 and frame 15 ?


Simple question. I'm using a spriteSheet for my animations and I actually know that to set my animation to a certain frame I have to use the currentFrame() function. But if I want only to set my animation between, let's say frame 10 and frame 15 ? How should I do that in code ?

Thank you for the support^^


Hey rayman,

That's a sample project (commented like a tutorial) that I put together showing how to set up that kind of thing.

It should show you how to do exactly what you want :)


Hi PEach ! That'S pretty awesome ! Thank you it helped me a lot to understand !
However, I use Spriteloq to make my spriteSheets and I think it doesn't include the sprite.add() function. If you know a work around to do the same thing in spriteLoq, I'll be glad to hear it ^^

From my experience with the software however, I think I should use his function SpriteFactory:MultiSet(_module, _spriteInfo) where we need to specify the metadata generated by SpriteLoq, the name of the sprite as defined in the sprite sheet, the frameCount where we know how many frames in the sprite's animation, the frameRate of the animation and the loop parameter. I think thats pretty much the same thing as your sprite.add() function. If yes, I'm glad to specify it here on this post so other can make the difference ;)

I'm afraid that I haven't used spriteLoq, although I've heard great things :)

You may want to make a post in the spriteLoq forum about it? (I wont consider it a duplicate thread as this one, I'm sure, could help others not using spriteLoq ;))


views:1430 update:2011/10/11 15:24:38
corona forums © 2003-2011