animated textures

Blitz3D Forums/Blitz3D Programming/animated textures

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Here is a simple technique for creating an animstrip:


;TotalWidth=Individual Frame Width*Number of Frames in total
TotalWidth=NumberofFrames*SpriteWidth
MyImage=CreateImage(TotalWidth,Height)
Dim MyFrame(NumberOfFrames)
for i=1 to NumberOfFrames
MyFrame(i)=loadimage("FileName in some format that includes a numeric identifier")
;Such as MyBitmap1.bmp, MyBitmap2.bmp MyBitmap3.bmp
;which can be loaded as MyFrame(i)=loadimage("MyBitmap"+Str(i)+".bmp")
;
setbuffer imagebuffer(MyImage)
DrawImage MyFrame(i),(i-1)*ImageWidth(MyFrame(i)),0

next
saveimage (MyImage,"Filename.bmp")
end