locked
How do I animate a .dds?

    Question

  • Hi,

    I did a quick search but can't seem to find anything on how to create an animated .dds file. I have an animated .gif but I get some random error code when I try to compile and it fails.

    If I'm going about this all wrong and you can't even animate .dds files code somebody point me in the right direction about how to get animations in games.

    Thanks.
    Sunday, September 17, 2006 1:23 PM

Answers

  • You can't. You'll have to save your animation as a set of static images, or alternatively (and better for performance) pack them into one larger image. Then you will have to write some code to draw the correct frame of the animation at a given time (i.e. look at the time and decide which frame to render).
    Sunday, September 17, 2006 1:44 PM

All replies

  • You can't. You'll have to save your animation as a set of static images, or alternatively (and better for performance) pack them into one larger image. Then you will have to write some code to draw the correct frame of the animation at a given time (i.e. look at the time and decide which frame to render).
    Sunday, September 17, 2006 1:44 PM
  • If you packed the seperate images into the dds file like a volume texture, then you could animate the texture by changing the w texture coordinate over a set period of time [As in (u,v,w)]. Otherwise you could do as AndyL suggests, and pack them into one large texture. In this case, you would use the u,v coordinates to clip the portion of the texture you would like to currently view. A simple helper function could be created to map an animation index value to the proper u,v coordinates. The SpriteBatch can clip these regions for you if you specify the rectanglar region that you wish to clip.
    Tuesday, September 19, 2006 2:18 AM