Beginnner to sprites : Basic help needed

BlitzMax Forums/BlitzMax Beginners Area/Beginnner to sprites : Basic help needed

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.

Basically you have an animstrip of what I can see of that image you posted. What you need to work out is how big each cell of the image is then load it in using the loadanimimage command. Say for instance you have an animstrip with 4 different frames (Like the image you have but yours has more frames). You use loadanimimage to load the animstrip in and define the size of each frame and to also put how many frames there are.

You would do the following:
Global myimage:TImage = LoadAnimImage("where_the_image_is.png",cellWidth,CellHeight,0,NumberOF Frmaes,MASKEDIMAGE)

then when you draw it you do the following

DrawImage myimage,XPosition,YPosition,FrameNumber

framenumber:+1

if frame number > 4 then framenumber = 0