Animated GIF in game

Hi Folks, So i’ve just got the hang of corona but i’m currently stuck with which direction to go.

I have a game and it will have an animated GIF as a background. i tried adding it as an image but it didn’t work. After some reading i’m getting the feeling i’m needing to head in the sprite direction?

Can anyone advise me please :smiley:

Thanks
Craig [import]uid: 13059 topic_id: 12274 reply_id: 312274[/import]

You can export the individual frames of your gif out to a png or jpg format and then use a movieclip to play them back in the background of your game. Movie clips are easier to implement than sprites.

Check out : Movieclip for more information.

– Chris [import]uid: 33866 topic_id: 12274 reply_id: 44705[/import]

You could animate a background using a bunch of images that are the same dimensions as the screen but it wouldn’t be a good idea because it would require too much memory (not to mention slow to load). It would be far more effecient to have a single static image as a background and then have some smaller sprites on top of it that could be animated. Here are links to the Corona docs about animation:

http://developer.anscamobile.com/content/animation
http://developer.anscamobile.com/reference/sprite-sheets [import]uid: 27965 topic_id: 12274 reply_id: 44706[/import]

It’s easier to do sprites. Import all the images it Zwoptex then you can export the sprite sheet. There is sample code on the Corona SDK sample apps. It’s easy and it isn’t a performance hog.

Regards,
Jordan Schuetz
Ninja Pig Studios [import]uid: 29181 topic_id: 12274 reply_id: 44719[/import]

Please disregard this… had previously asked how to get the background in the background using Zwoptex, but got it figured out (object:toBack()). [import]uid: 144359 topic_id: 12274 reply_id: 109360[/import]