•  Back 
  •  Main 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The GFA-Basic Compendium
Author      : GFA Systemtechnik GmbH
Version     : GFABasic.HYP v2.98 (12/31/2023)
Subject     : Documentation/Programming
Nodes       : 899
Index Size  : 28056
HCP-Version : 3
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : Document not found
@help       : Help
@options    : +g -i -s +z
@width      : 75
@hostname   : STRNGSRV
@hostname   : CAB     
@hostname   : HIGHWIRE
@hostname   : THING   
View Ref-FileSPRITE bit_pattern$[,x,y]

bit_pattern$: svar
x, y: aexp

The SPRITE command enables a 16x16 pixel block to be moved around the screen.
The appropriate bit information for the pattern and its mask is put into the
string bit_pattern$. All values must be given in word size. For this purpose
one can use the command MKI$(), so bit_pattern$ is formed as follows:

bit_pattern$ = MKI$(x-coordinate of action point)
             + MKI$(y-coordinate of action point)
             + MKI$(0)            !0=normal or -1=XOR
             + MKI$(mask color)   !usually 0
             + MKI$(sprite color) !usually 1
             + sprite$

With 'SPRITE bit_pattern$,x,y' the sprite is first drawn or moved if already on
the screen. With 'SPRITE bit_pattern$' the sprite is erased from the screen
display.

Contained in sprite$ is the bit information for the sprite shape and its mask,
which must be specified, unlike DEFMOUSE, not successively but alternately.

Example:

    gfa$=MKI$(1)+MKI$(1)+MKI$(0)
    gfa$=gfa$+MKI$(0)+MKI$(1)
    FOR i%=1 TO 16
      READ pattern%,mask%
      gfa$=gfa$+MKI$(mask%)+MKI$(pattern%)
    NEXT i%
    DATA 0,0,0,32256,15360,16896,8192,24064
    DATA 8192,24560,11744,21008,9472,23280,9472,23295
    DATA 15838,16929,274,32493,274,749,286,737
    DATA 18,1005,18,45,18,45,0,63
    REPEAT
      ADD mx%,(MOUSEX-mx%)/50
      ADD my%,(MOUSEY-my%)/50
      SPRITE gfa$,mx%,my%
    UNTIL MOUSEK=2
    SPRITE gfa$

--> A sprite moves over the screen, following the movement of the mouse
    pointer.

Memo: This should be considered a Line-A command.
      Use it carefully or not at all.
      Sprite strings must be exactly 74 bytes in length.

Line-A Draw Sprite+, Line-A Undraw Sprite+