GLBasic User Manual

Main sections


LOADANIM filename$, id%, w%, h%

LOADANIM loads image file filename$ splitting it into pieces (animation frames) that are w% pixels wide and h% pixels high.
The individual frames can be drawn with the DRAWANIM command.

The frame count will increase by 1 for each frame in the image. Frames will be created from left to right across the image starting at the top left hand corner. When there is no more room in the image horizontally to make another frame, if there is room vertically for another set of frames then frame creation will start again from the left column, h% pixels down.

e.g. Frames are created from an image like this:
// 0 1 2 3
// 4 5 6 7

LOADANIM "test.bmp", 0, 32,32
FOR x=0 TO 16
FOR y=0 TO 16
DRAWANIM 0, x + y*16, 36*x, 36*y

See also...