Animation Error

Blitz3D Forums/Blitz3D Programming/Animation Error

Inexperienced(Posted 2013) [#1]
So my image is 200,50 and has 4 frames.

playership = LoadAnimImage("ship.jpg",200,50,0,4)

Comes up with an error saying that the image does not have enough frames. Any help would be appreciated, I'm just a little new to Blitz.


Kryzon(Posted 2013) [#2]
If your image has 4 frames of 200x50 each, then the image must be bigger than 200x50 in either dimension.

The sprite sheet file that you send to LoadAnimImage contains all the frames sequentially, so it's always bigger than the individual frames in either dimension.

The frames can all be arranged horizontally, so your sprite sheet size is: 800x50.
The frames can all be arranged vertically, so your sprite sheet size is: 200x200.
The frames can be arranged in a "matrix" or "photo array" manner, which has more than one column per row and it spans several rows: 400x100 (2 frames horizontally, 2 rows), or 600x100 (3 frames horizontally, then one frame in the bottom row and the rest is blank space that's ignored) etc.

If your image does not fit in any of the above cases (even if it misses the appropriate size by a single pixel), it'll throw an error like that.


Inexperienced(Posted 2013) [#3]
The images are 50x50 each and are on a 200x50 image. 1 Row of 4.
I think I understand what you are saying though, thanks!

So it should be
x=("x",50,50,0,4)
The 200 was screwing everything up.

And it worked :P thanks.