|
void | hide_sprites_range (UINT8 from, UINT8 to) OLDCALL |
|
uint8_t | move_metasprite_ex (const metasprite_t *metasprite, uint8_t base_tile, uint8_t base_prop, uint8_t base_sprite, int16_t x, int16_t y) |
|
uint8_t | move_metasprite (const metasprite_t *metasprite, uint8_t base_tile, uint8_t base_sprite, int16_t x, int16_t y) |
|
uint8_t | move_metasprite_flipx (const metasprite_t *metasprite, uint8_t base_tile, uint8_t base_prop, uint8_t base_sprite, int16_t x, int16_t y) |
|
uint8_t | move_metasprite_vflip (const metasprite_t *metasprite, uint8_t base_tile, uint8_t base_sprite, int16_t x, int16_t y) |
|
uint8_t | move_metasprite_flipy (const metasprite_t *metasprite, uint8_t base_tile, uint8_t base_prop, uint8_t base_sprite, int16_t x, int16_t y) |
|
uint8_t | move_metasprite_hflip (const metasprite_t *metasprite, uint8_t base_tile, uint8_t base_sprite, int16_t x, int16_t y) |
|
uint8_t | move_metasprite_flipxy (const metasprite_t *metasprite, uint8_t base_tile, uint8_t base_prop, uint8_t base_sprite, int16_t x, int16_t y) |
|
uint8_t | move_metasprite_hvflip (const metasprite_t *metasprite, uint8_t base_tile, uint8_t base_sprite, int16_t x, int16_t y) |
|
void | hide_metasprite (const metasprite_t *metasprite, uint8_t base_sprite) |
|
Metasprite support
A metasprite is a larger sprite made up from a collection of smaller individual hardware sprites. Different frames of the same metasprites can share tile data.
The api supports metasprites in both SPRITES_8x8 and SPRITES_8x16 mode. If 8x16 mode is used then the height of the metasprite must be a multiple of 16.
The origin (pivot) for the metasprite is not required to be in the upper left-hand corner as with regular hardware sprites.
Use the utility_png2asset tool to convert single or multiple frames of graphics into metasprite structured data for use with the ...metasprite...() functions.
Metasprites composed of variable numbers of sprites
When using png2asset, it's common for the output of different frames to be composed of different numbers of hardware sprites (since it's trying to create each frame as efficiently as possible). Due to that, it's good practice to clear out (hide) unused sprites in the shadow_OAM that have been set by previous frames.
volatile struct OAM_item_t shadow_OAM[]
unsigned char uint8_t
Definition: stdint.h:51
Metasprites and sprite properties (including cgb palette)
When the move_metasprite_*() functions are called they update all properties for the affected sprites in the Shadow OAM. This means any existing property flags set for a sprite will get overwritten.
How to use sprite property flags with metasprites:
- Metsaprite structures can be copied into RAM so their property flags can be modified at runtime.
- The metasprite structures can have the property flags modified before compilation (such as with
-sp <props>
in the png2asset tool).
- Update properties for the affected sprites after calling a move_metasprite_*() function.