1.5 Sprites Window


void show_sprites(); /* Enable Sprites */

show_sprites() displays sprites properly configured on the visible screen.
* Note : Newer GBDK versions support SHOW_SPRITES;


void hide_sprites(); /* Disable Sprites */

hide_sprites() makes all sprites not visible.


void sprites8x8(); /* Set Spritesize to 8x8 */

Sets the sprites to be eight pixels wide by eight pixels tall.
* Note : Newer GBDK versions support SPRITES_8x8;


void sprites8x16(); /* Set Spritesize to 8x16 */

Sets the sprites to be eight pixels wide by sixteen pixels tall.
* Note : Newer GBDK versions support SPRITES_8x16;


void set_sprite_data(int first_tile, int nb_tiles, unsigned char *data);

/* 0 <= first_tile <= 255 * 0 <= first_tile+nb_tiles <= 255 * nb_tiles >= 1 */
set_sprite_data loads data into the sprite ram area. By doing this, sprites
are able to contain the patterns you have designed. first_tile is the first
tile from the data to be loaded. nb_tiles is the number of tiles that you
want to be loaded. *data is a pointer to an unsigned char that contains the
tile data you want to be loaded.


void set_sprite_tile(int nb, int tile); /* 0 <= nb <= 39 * 0 <= tile <= 255 */

set_sprite_tile configures sprites so that they can be visible by loading
the sprite tile into the selected sprite. nb refers to which of the 40 visible
sprites you would like to load data into. tile is an integer refering to which
tile from the loaded data set in set_sprite_data you want to be accessed by
the sprite.


void set_sprite_prop(int nb, int prop); /* 0 <= nb <= 39 */

** sprite propperties (use with set_sprite_prop) **
S_PALETTE
S_FLIPX
S_FLIPY
S_PRIORITY
set_sprite_prop sets properties for each sprite. S_PALETTE (gameboy color
only) contains the palette information. S_FLIPX allows the x-axis to be
flipped/mirrored. S_FLIPY allows the y-axis to be flipped/mirrored. S_PRIORITY
contains data referring to if this tile should be on top of other tiles or not.

void move_sprite(int nb, int x, int y);

/* 0 <= nb <= 39 * 0 <= x <= 255 * 0 <= y <= 255 */
move_sprite moves the specified sprite to another x-y location. nb is the number of
the sprite (0-39) that you would like to move. x is the new x-location for the sprite.
y is the new y-location for the sprite.