Using Gifs for sprites

Blitz3D Forums/Blitz3D Beginners Area/Using Gifs for sprites

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.

Create your sprites/images/tiles of an equal size. Make another image the length and height times by how many you want in you sprite bank.

E.g say your seperate images are 32 x 32, and you wanted to store and use 20 sprites. Either have them as a strip 20x32=width, and height=32 will give you 20 equal spaces to put the gfx in. Or you could have them in a grid, ie 5 across by 4 down (5x32 = width, 4x32 = height). Just times the amount you want across and down by the size of the tile.

(syntax: LoadAnimImage("filename.extension",width_of_tile,height_of_tile,start(usually 0 - the first tile,how_many_tiles)

Now call them in blitz using your dimensions

Global graphics_bank=LoadAnimImage("graphics.gif",32,32,0,20)

;and use

DrawImage graphics,pos_x,pos_y,tile_number


Hope this helps you