Animated Sprites

Blitz3D Forums/Blitz3D Beginners Area/Animated Sprites

Crazy4Code(Posted 2006) [#1]
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?


Matty(Posted 2006) [#2]
Use a loadanimtexture command, and change the texture frame much in the same way you would change the frame in an image.


Crazy4Code(Posted 2006) [#3]
And you CreateSprite() and apply that texture to the sprite?


Matty(Posted 2006) [#4]
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 





Crazy4Code(Posted 2006) [#5]
And then whenever the texture frame should change, I re-texture the sprite right?


Matty(Posted 2006) [#6]
That is right, simply call entitytexture with a different frame parameter.


W(Posted 2006) [#7]
What exactly is an animated texture guys??


jhocking(Posted 2006) [#8]
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.


W(Posted 2006) [#9]
Oh gracious,thanks, Joe!