Rows In Images

Blitz3D Forums/Blitz3D Beginners Area/Rows In Images

Q(Posted 2005) [#1]
I have been using LoadAnimImages to use frames in my 2d animations. Is it possible to load a certain row, like in this image for example: , using this command?

If so, or not, how?


Perturbatio(Posted 2005) [#2]
LoadAnimImage has a parameter - first

You can multiply the number of tiles wide by the row number to get the first value.

i.e.
LoadAnimImage("my image", 24,24, 10*rownum, 10)



Q(Posted 2005) [#3]
That was easy! Thanks :o)


Perturbatio(Posted 2005) [#4]
np :)


JazzieB(Posted 2005) [#5]
You can't load a certain row of an image using the LoadAnimImage function. The first parameter is to tell Blitz what to start numbering the frames from - usually 0 or 1, but could be anything else.


Perturbatio(Posted 2005) [#6]
The first parameter is to tell Blitz what to start numbering the frames from - usually 0 or 1, but could be anything else.

ummm...

Graphics 640,480,0,2

Global img = LoadAnimImage("dg_armor32.bmp", 32,32,10, 10)
Global frame = 0

While Not KeyDown(1)
Cls
	DrawImage img, MouseX(), MouseY(), frame
	If MouseHit(1) Then frame = frame +1
	If frame > 9 Then frame = 0
Flip
Wend
End