Loading animated sprites
Blitz3D Forums/Blitz3D Programming/Loading animated sprites
| ||
Im trying to have a sprite have an animated pic Tryed using a gif format and got an error. What formats can you use to have a sprite with an animation? |
| ||
bmp, jpg, tga, png... the same file formats as for non-animated textures. Animated textures are done as filmstrips (ie. all the frames of animation laid out on a static image.) |
| ||
Ahh, I understand what you mean. Ive seen it done it games befor. So lets say I have an image with 4 fames layed out on it- How do I code it so it moves to the next? If you dont have time to write out the code could you just point me to the right commands please. thx |
| ||
It's kind of annoying but ultimately pretty flexible how Blitz works with animated textures. You load the texture using LoadAnimTexture to break up the image into the separate frames. Then you increment the frame on an object by repeatedly using EntityTexture (or whatever texture command you want) and changing the frame parameter each time you apply the texture. The frame is the third parameter (first optional parameter) of the EntityTexture command. |
| ||
LoadAnimImage DrawImage |
| ||
Alright thx ill go give it a shot |