Amos Professional Manual  Contents  Index

Icons and Blocks


This Chapter deals with the practical handling of rectangular units of graphic images.

Background screen graphics
It is common for modern arcade games to feature hundreds of different background screens, over which the animated action takes place. Similarly, practical programs like kitchen-planners may need to display scores of varied settings. A fraction of these requirements would normally exhaust your Amiga's memory, leaving no room at all for your program!

To overcome this restriction, backgrounds can be constructed from a set of simple graphic blocks, to be arranged and re-arranged as you wish, in varied patterns Each background screen can now be stored as a simple list of component blocks. These blocks are sometimes known as "tiles", and AMOS Professional provides two sets of alternative tiles: Icons, which are held in their own memory bank, and Blocks, which are held as temporary data.

Icons
An Icon is an individual image, specifically designed to act as a component of a background screen picture. All Icons are stored in their own AMOS Professional memory bank, which is bank 2, and this Icon Bank will be saved along with your program listing automatically.

Once an Icon is drawn it has a fixed location and cannot be moved to another part of the screen.

Icons are displayed using the Amiga's Blitter chip, which is also responsible for the display of Robs. However, because Icons are essentially static Objects, they are normally drawn in replace mode. This means that any existing graphics at the relevant screen location will be completely erased by the Icon.

Here is a complete list of the Icon commands.

GET ICON
instruction: create an Icon
Get Icon Icon number,x1,y1 To x2,y2
Get Icon screen number,lcon number,x1,y1 To x2,y2

The GET ICON command grabs an image from the screen and loads it into an Icon. Specify the Icon number, and then give the coordinates of the rectangle that is to be grabbed, from the top left-hand corner to the bottom right-hand corner. If the Icon whose number you specify does not already exist, it will be created in Bank 2. If the memory bank has not been reserved, this will also be done automatically.

An optional screen number can also be given, immediately after the GET ICON instruction, and this will select the screen to be used as the source of the Icon's image. If this screen number is omitted, the image is taken from the current screen.

GET ICON PALETTE
instruction: load Icon colours into current screen
Get Icon Palette

This instruction is usually employed to initialise a screen, after Icons have been loaded from disc.

Back    Next
07.07.01