| Header | {z88dk}/include/games.h |
|---|---|
| Source | {z88dk}/libsrc/graphics |
| Include | #include <games.h> |
| Linking | n/a |
| Compile | n/a |
| Comments |
These library functions are part of the monochrome graphics functions, thought to be easily portable.
The sprite functions are based on a special data structure permitting dynamic sprite sizes: the first two bytes define the sprite size, while the next ones describe the picture.
The bits are right-padded to fill the last byte in a row.
Pick up a sprite directly from the screen.
This functions isn’t still working.
Draw a sprite of variable size it can behave in three different ways, to be specified in the “ortype” parameter:
the sprite will just be printed on the screen without deleting what’s already there
the sprite will be XORed with the pictures already present on the screen
the sprite will be “printed in white”, eventually leaving a shape. This feature permits the use of “sprite masks”.
Saves the screen area in a sprite-like structure. Position and size are saved in it (taking 4 bytes), but the area granularity works at byte-level, to run faster.
Example:
char *background; background=malloc( 4 + (width/8+1) * (height) ); sprintf(background, "%c%c",width,height); bksave(x,y,back);
Restores the background area.
Example:
bkrestore(background);
This is a simple sprite editor for z88dk with it’s main feature being that it automatically will generate code for you.
Its features make it very useful to create animated sprite arrays and to import external pictures into sprite structures.
Up / Down......................Zoom In / Out
SHIFT + arrow keys.............Scroll Sprite
H..............................Flip sprite horizontally
V..............................Flip sprite vertically
D..............................Flip sprite diagonally
I..............................Invert Sprite
L..............................Import From BMP or PCX
C..............................Choose Source Sprite for Copying (copy)
P..............................Copy Source sprite to current sprite (paste)
SHIFP + P......................Divide the source sprite into pieces and paste them to the
destination and its following ones.
M..............................Compute mask for copied sprite and paste to current sprite
F2.............................Saves all sprites into a sprite file (not code) F3.............................Load sprites from sprite file (not code) F5.............................Save code file generating code from sprite 0 - selected