Amos Professional Manual  Contents  Index

IFF Animation


For example:

E> Rem Play the first frame in Bank 10 using screen 0
   F=Frame Play(10,1,0)
   Double Buffer : Rem activate non automatic double buffer
   Rem Display next frame
   F=Frame Play(F,1)

When the end of the animation sequence has been reached, your F variable points to the last frame of the animation. Because the exact number of frames is returned to the FRAME LOAD function, FRAME PLAY can be enclosed in a loop for simplicity, like this:

E> Open In 1,"AMOSPro_Tutorialiff_Anim/AMOS.Anim"
   L=Frame Load(1 To 10,1000)
   Close
   Rem Play first frame from Bank 0 and define new screen 0
   Do
    P=Frame Play(10,1,0)
    Double Buffer
    For X=2 To L-1 : Rem Play sequence to the end
     P=Frame Play(P,1) : Rem Play next frame
     Screen Swap : Rem Make animation visible
     Wait Vbl : Wait Vbl : Wait Vbl
    Next X
   Loop

FRAME SKIP
function: skip past an animation frame
s=Frame Skip(bank/address)
s=Frame Skip(bank/address,number)

This is exactly the same as FRAME PLAY, except that no output is made to the screen. FRAME SKIP omits any selected frames and returns the address of the next frame to be played in the sequence. The bank or address number of a valid IFF animation frame is given, followed by the number of frames to be skipped over.

Use FRAME SKIP carefully, because frames are stored relative to the existing screen background. This means that the animation will only re-commence when an identical frame is reached to the one currently being displayed.

FRAME PARAM
function: return a parameter after playing a frame
p=Frame Param

This function returns the amount of time needed to successfully display an animation on screen, measured in 50ths of a second. It is used after FRAME PLAY or FRAME SKIP to delay the program until the screen has been totally re-drawn.

Back    Next
07.05.06