Animated Sprites
Blitz3D Forums/Blitz3D Beginners Area/Animated Sprites
| ||
I don't see any LoadAnimSprite or any functions relating to animated sprites like there were with 2D images. Does that mean the only way to work an animated sprite is to store all the different images in an array or what? |
| ||
Use a loadanimtexture command, and change the texture frame much in the same way you would change the frame in an image. |
| ||
And you CreateSprite() and apply that texture to the sprite? |
| ||
Yes, simply do something like this:mysprite=createsprite() ;createsprite returns a handle which we store in mysprite myanimatedtexture=loadanimtexture(file$,flags,frame_width,frame_height,first_frame,frame_count );check in the docs what the arguments for this function are entitytexture mysprite,myanimatedtexture,frame ;where frame is the frame of the animated texture to apply |
| ||
And then whenever the texture frame should change, I re-texture the sprite right? |
| ||
That is right, simply call entitytexture with a different frame parameter. |
| ||
What exactly is an animated texture guys?? |
| ||
It's like an anim strip for 2D images. Basically all the animation frames are lined up in one image, and then you can use that image as a texture and cycle through the frames. |
| ||
Oh gracious,thanks, Joe! |