Amos Professional Manual  Contents  Index

Updating Objects


If you are using double buffered screens, a separate copy of the background area is created for each of the two screens. At the end of a display routine, the logical and physical screens are swapped around by the system, to ensure that these two screens are perfectly synchronised. All the time that the contents of an animated screen stay completely still, there can be no problems with updating a static image. Unfortunately, as soon as the contents of a screen changes, the saved sections of the previous picture will be copied straight onto the updated screen, and corrupt the picture. This can only be solved if all of the standard drawing commands are synchronised with both the physical and logical screens, and AMOS Professional achieves this by means of the powerful AUTOBACK system.

AUTOBACK is extremely intelligent and completely automatic, but it can only synchronise graphics and text commands. If you wish to manipulate the screen directly with SCREEN COPY or SCROLL, you must handle the process yourself. In other words, you will have to keep the logical and physical screens in step with one another and perform exactly the same operations in both screens.

This routine demonstrates the danger of flicking between these screens when different items are held in the two components of double buffering:

E> Double Buffer
   Autoback 0
   Do
    Paper 4 : Print "Hello from the first screen"
    Screen Swap : Wait Vbl
    Paper 6 : Print "Greetings from screen two"
    Screen Swap : Wait Vbl
   Loop

The updating commands
Under normal circumstances, AMOS Professional displays all Bobs at once. So if any Bob coordinates are changed, that Bob can be expected to appear at its new position immediately.

Unfortunately, the Amiga's hardware is only capable of re-drawing a limited number of objects on screen in any single display cycle. This means that if you try and move several Bobs at once, it is almost inevitable that some of those objects will be re-positioned at slightly different times. This phenomenon generates unpleasant jerky movements. Thankfully, AMOS Professional provides a simple solution to this problem.

BOB UPDATE
instruction: move many Bobs simultaneously
Bob Update
Bob Update Off
Bob Update On

BOB UPDATE performs all Bob movements in a single, mighty burst, so all objects are moved at the same instant in your program. The resulting movement effects are now incredibly smooth, even with dozens of objects on screen at once. BOB UPDATE is extremely easy to use, as the following technique explains.

Back    Next
07.03.03