Download Amos Pro Manual

Transcript
Blitter Objects
Here is an example:
E> Load "AMOSPro_Tutorial:Objects/Bobs.abk" : Rem Load Bob images from disc
Curs Off.: Cls 0 : Rem Set up screen
Flash Off : Get Bob Palette : Rem Grab Bob colours from image bank
Double Buffer : Rem Engage Double Buffering
For X=360 To -60 Step -4: Rem Move Bob across screen
Bob 1,X,100,2 : Rem Display Bob at a new position
Wait Vbl : Rem Wait for next vertical blank period
Next X
For X=-60 To 400 Step 4: Rem Flip image and move from left to right
Bob 1,X,100,Hrev(2) : Rem Display Bob at new position
Wait Vbl : Rem Wait 50th of second for Vbl
Next X
There is a hexadecimal version of this function, and the value returned by the HREV function is in the following
format:
$800+n
Where $8000 is a "flag" telling AMOS Professional to reverse the Bob whenever it is displayed on screen, and
where n is the number of your image. This technique can be used to flip images directly from an AMAL animation
sequence.
Supposing your original sequence was created with this:
X> "Anim 0,(1,2)(2,2)(3,2)(4,2)"
To reverse these images, either of the following two lines could be used:
X> "Anim 0,($8000+1,2)($8000+2,2)($8000+3,2)($8000+4,2)"
X> "Anim 0,($8001,2)($8002,2)($8003,2)($8004,2)"
When an image is reversed like this, the location of the hot spot is reversed horizontally too. So if the hot spot was
originally in the top left-hand corner, the hot spot of the HREV image will be in the top right-hand corner:
Depending on the image involved, this can have a great effect on the way your image is displayed on screen. Be
careful to position your hot spots sensibly, or avoid any risks by setting them centrally, using the appropriate HOT
SPOT command.
VREV
function: flip an image vertically
new number=Vrev(image number)
VREV is identical to HREV, except that it takes the specified image and turns it upside down before displaying it on
the screen. This is best used for animated objects that move vertically, although comic effects can be achieved with
cartoon characters.
07.02.11