IFF Animation  Contents  Index

IFF Animation


LENGTH, simply give the channel number of the IFF file previously opened with the OPEN IN command.

You may also specify the number of frames to be taken into consideration. If this number is omitted, only the first frame in the animation with be checked. Alternatively, if an overlarge number is specified, the exact memory requirements of all the frames in the current file will be returned.

FRAME LENGTH does not change the position of the file pointer, but leaves it at the start of the next animation frame to be loaded. So it can be used immediately before a FRAME LOAD command to check the memory requirement of your new animation. For example:

E> Open In 1 ,"AMOSPro_Tutorial:Iff_Anim/AMOS.Anim"
   Rem Load first frame only into memory
   L=Frame Length(1)
   Rem Reserve space for the frame in Bank 10
   Reserve As Work 10,L
   N=Frame Load(1 To 10)
   Close
   Print "Required memory for frame 1=";L

FRAME PLAY
function: play frames on screen
frame=Frame Play(bank/address,number)
frame=Frame Play(bank/address,number,screen)

Use this function to display animations on screen at the appropriate points in your programs. Specify the memory address or bank number containing an IFF animation sequence that has already been loaded by FRAME LOAD. Please note that addresses must be even and that the first bytes must be a valid IFF Frame definition. Next specify the number of frames that you want to play.

The optional screen parameter is the identifier of a new screen to be created for the animation, and it can be used to automatically define a screen as the first frame of the animation to be displayed. If this screen number is omitted, an attempt will be made to use the current screen.

Please note that your new screen will not be set up for double buffering, and you should activate this directly from your program with the DOUBLE BUFFER command, if required. Also, the IFF animation will be displayed on the logical screen, and when using double buffering SCREEN SWAP must be employed, otherwise the animation will run invisibly in the background!

Once the FRAME PLAY function has been called, the start address of the next frame in the sequence will be returned, and this address can be used to display the following frame of the animation.

Back    Next
07.05.05