home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1992-09-28 | 6.4 KB | 182 lines |
- '***************************
- '* AMOS Professional *
- '* * Iff Anim (line 24)
- '* IFF ANIMATION * Frame Load (line 41)
- '* * Frame Length (line 71)
- '* (c) Europress Software * Frame Play (line 85)
- '* * Frame Skip (line 102)
- '* Ronnie Simpson * Frame Param (line 112)
- '***************************
- '
- '
- '-------------------------------------------
- 'GENERAL
- '-------------------------------------------
- 'AMOS Professional uses animations compressed in Mode 5 (the default setting
- 'Of Deluxe Paint). The first frame of your animation contains the background
- 'details against which all other frames are tested and only the changes are
- 'stored.
- 'Sequences can only be played forwards although commands are included which
- 'allow certain frames to be skipped.
- 'Because of the efficiency of the AMOS Pro. routines each frame may have to
- 'be slowed down to keep the same speed as the development package. (1/50th.
- '(of a second per frame for D/Paint anims for example)
- '
- '-------------------------------------------
- 'Iff Anim
- '-------------------------------------------
- 'play an animation file
- '
- 'This is the easiest way of playing a complete animation from start to finish.
- '
- ' +--->file name to be loaded
- ' | +--->screen number
- ' | | +--->optional number of times
- ' Iff Anim F$ To 0,2
- '
- 'If the number of times parameter is ommited the sequence will only be
- 'played once.
- 'If the destination screen already exists then it will be overwritten.
- 'When animation is complete memory is released back to the system.
- '
- '-------------------------------------------
- 'Frame Load
- '-------------------------------------------
- 'load animation frames to memory
- '
- ' +--->=number of frames loaded
- ' | +--->channel number
- ' | | +--->bank number
- ' N=Frame Load (1 to 6)
- '
- 'In its simplest form (as above) the Frame Load function loads the first
- 'frame of an anim. file into the specified bank number, the bank will be
- 'reserved automatically in fast memory.
- 'An optional number of frames number may be added which will load this number
- 'of frames to a bank, if this number is equal to or greater than the total
- 'number of frames in the anim. then all frames will be loaded:-
- '
- ' N=Frame Load (1 to 6,999) (load all frames to bank 6)
- '
- 'Upon completion of the loading 'N' would contain the actual number of frames
- 'loaded and no error would be generated by use of the over-large number of
- 'frames parameter.
- '
- 'Another version of this function loads your anim. directly to an address in
- 'memory, in this case it is best to find the size of memory required with the
- 'Frame Length function (see below) to avoid over-running your reserved memory
- 'area and crashing the system.
- '
- ' N=Frame Load (1 to X,999) (Where X=the memory start address)
- '
- '-------------------------------------------
- 'Frame Length
- '-------------------------------------------
- 'return the length of selected frames
- '
- ' +--->=channel number
- ' | +--->number of frames to be calculated
- ' | |
- ' L=Frame Load (1,6)
- '
- 'If the number of frames parameter is omitted then only the first frame is
- 'calculated and once again an over-large number may be used to calculate all
- 'frames, the value returned is the total number of bytes.
- '
- '-------------------------------------------
- 'Frame Play
- '-------------------------------------------
- 'play a loaded animation
- '
- ' +--->=Bank number
- ' | +--->number of frames
- ' | | +--->destination screen number
- ' F=Frame Play (6,20,1)
- '
- 'If the screen number parameter is ommited then the anim. will try to play
- 'to the current screen, note that double buffering will not be automatically
- 'set up.
- 'The total number of frames loaded can be found in the value returned by the
- 'Frame Load function.
- 'The Bank number may be replaced by the start address in memory of the anim.
- '
- '-------------------------------------------
- 'Frame Skip
- '-------------------------------------------
- 'miss an animation frame
- '
- 'Form skip is identical to Frame Play except that no output is made to
- 'the screen
- '
- 'eg. S=Frame Skip (6,2) (Skip 2 frames from anim. in bank 6)
- '
- '-------------------------------------------
- 'Frame Param
- '-------------------------------------------
- 'return playing time of animation
- '
- 'This instruction is used after Frame Play or Frame Skip to delay the program
- 'until the screen is totally refreshed.
- 'Value returned is in 1/50ths. of a second.
- '
- 'eg. Wait Frame Param
- '-------------------------------------------
- 'EXAMPLE
- '-------------------------------------------
- '
- Screen Open 0,640,200,4,Hires : Flash Off : Curs Off
- Palette 4,$FF : Cls 0 : Pen 1 : Paper 0 : Hide
- Locate 0,12 : Centre "Please wait..." : Wait Vbl
- '
- Rem *** load the animation into bank 10 and print details
- '
- Open In 1,"AMOSPro_Tutorial:IFF_Anim/AMOS.Anim"
- MEMORY=Frame Length(1,999)
- NOF=Frame Load(1 To 10,999)
- Fade 2,4,4 : Wait 30 : Cls 0
- Locate 0,5 : Centre "Total number of frames="+Str$(NOF)
- Locate 0,7 : Centre "Total length in bytes="+Str$(MEMORY)
- Locate 0,20 : Centre "Press any mouse key to see the Animation"
- Fade 2,4,$FF
- Repeat : Until Mouse Key
- Close 1
- '
- Rem *** The easiest way to play this animation would be to use the Iff Anim
- Rem *** command but the following should give an insight on how to display
- Rem *** single frames and custom anims.
- '
- 'For TIMES=1 To 5
- '
- Rem *** display the first frame from bank number 10 on screen number 0
- FLAG=Frame Play(10,1,0)
- '
- Rem *** double buffer the screen
- '
- Double Buffer
- '
- Rem *** start the loop to show the rest of the frames
- '
- For X=2 To NOF
- '
- Rem *** load the next frame to the logical screen
- '
- FLAG=Frame Play(FLAG,1)
- '
- Rem *** swap the logical and physical screens
- '
- Screen Swap
- '
- Rem *** make sure the screen has time to be re-drawn
- '
- Wait Frame Param+1
-
- '
- Rem *** ready for next frame
- '
- Next X
- '
- Rem *** repeat the full animation another 4 times
- '
- ''Next TIMES
- '
- Edit