Amos Professional Manual  Contents  Index

Graphics


View them now, by running this routine:

D> Do
    For N=0 To 34
     Set Pattern N
     Ink 0,1,2: Set Paint 1
     Bar 50,50 To 150,150
     Locate 0,0: Print N ;" "
     Wait 50
    Next N
   Loop

If SET PATTERN is followed by a negative number, shapes will be filled with a pattern grabbed from a Sprite or Bob image, taken from the Object Bank (memory bank 1). Because these patterns can be very complex, AMOS Professional will simplify them automatically, as follows.

The width of the image is clipped to 16 pixels, and the height is rounded to the nearest power of two (2, 4, 8, 16, 32 and so on.)

The original colours of the image are discarded, and the pattern is drawn using the current ink and paper colours. Two-colour patterns are drawn as monochrome images.

If multi-coloured images are required using the original Object colours, the INK must first be set up, as follows:

X> Ink 15,0
   Set Pattern -1
   Paint 100,100

That example fills the screen area around the given coordinates with any of the Object colours, except the transparent colour zero. The colour index number 15 acts as a mask, defining which colours are to be used, and sets the range from 1 to 15. If the INK command is changed to the following line, the Object will be drawn with the normally transparent colour filled by colour 1:

X> Ink 15,1

Before making use of sprite images as fill patterns, remember to use GET SPRITE PALETTE to avoid messy displays. Here is an example:

E> Flash Off : Cls 0
   Load "AMOSPro_Tutorial:Objects/Pattern.Abk"
   Get Sprite Palette
   Box 1,1 To 319,199
   Ink 15,0
   Set Pattern -1
   Paint 102,102
Back    Next
06.04.09