Arduboy2 Library
6.0.0
|
A class for drawing animated sprites from image and mask bitmaps. Optimized for small code size. More...
#include <SpritesB.h>
Static Public Member Functions | |
static void | drawExternalMask (int16_t x, int16_t y, const uint8_t *bitmap, const uint8_t *mask, uint8_t frame, uint8_t mask_frame) |
Draw a sprite using a separate image and mask array. More... | |
static void | drawPlusMask (int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame) |
Draw a sprite using an array containing both image and mask values. More... | |
static void | drawOverwrite (int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame) |
Draw a sprite by replacing the existing content completely. More... | |
static void | drawErase (int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame) |
"Erase" a sprite. More... | |
static void | drawSelfMasked (int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame) |
Draw a sprite using only the bits set to 1. More... | |
A class for drawing animated sprites from image and mask bitmaps. Optimized for small code size.
The functions in this class are identical to the Sprites
class. The only difference is that the functions in this class are optimized for smaller code size rather than execution speed.
See the Sprites
class documentation for details on the use of the functions in this class.
Even if the speed is acceptable when using SpritesB
, you should still try using Sprites
. In some cases Sprites
will produce less code than SpritesB
, notably when only one of the functions is used.
You can easily switch between using the Sprites
class or the SpritesB
class by using one or the other to create an object instance:
Definition at line 40 of file SpritesB.h.
|
static |
"Erase" a sprite.
x,y | The coordinates of the top left pixel location. |
bitmap | A pointer to the array containing the image frames. |
frame | The frame number of the image to erase. |
Definition at line 21 of file SpritesB.cpp.
|
static |
Draw a sprite using a separate image and mask array.
x,y | The coordinates of the top left pixel location. |
bitmap | A pointer to the array containing the image frames. |
mask | A pointer to the array containing the mask frames. |
frame | The frame number of the image to draw. |
mask_frame | The frame number for the mask to use (can be different from the image frame number). |
Definition at line 10 of file SpritesB.cpp.
|
static |
Draw a sprite by replacing the existing content completely.
x,y | The coordinates of the top left pixel location. |
bitmap | A pointer to the array containing the image frames. |
frame | The frame number of the image to draw. |
Definition at line 16 of file SpritesB.cpp.
|
static |
Draw a sprite using an array containing both image and mask values.
x,y | The coordinates of the top left pixel location. |
bitmap | A pointer to the array containing the image/mask frames. |
frame | The frame number of the image to draw. |
Definition at line 31 of file SpritesB.cpp.
|
static |
Draw a sprite using only the bits set to 1.
x,y | The coordinates of the top left pixel location. |
bitmap | A pointer to the array containing the image frames. |
frame | The frame number of the image to draw. |
Definition at line 26 of file SpritesB.cpp.