Arduboy2 Library  6.0.0
Sprites.h
Go to the documentation of this file.
1 
7 #ifndef Sprites_h
8 #define Sprites_h
9 
10 #include "Arduboy2.h"
11 #include "SpritesCommon.h"
12 
75 class Sprites
76 {
77  public:
115  static void drawExternalMask(int16_t x, int16_t y, const uint8_t *bitmap,
116  const uint8_t *mask, uint8_t frame, uint8_t mask_frame);
117 
152  static void drawPlusMask(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame);
153 
183  static void drawOverwrite(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame);
184 
214  static void drawErase(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame);
215 
244  static void drawSelfMasked(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame);
245 
246  // Master function. Needs to be abstracted into separate function for
247  // every render type.
248  // (Not officially part of the API)
249  static void draw(int16_t x, int16_t y,
250  const uint8_t *bitmap, uint8_t frame,
251  const uint8_t *mask, uint8_t sprite_frame,
252  uint8_t drawMode);
253 
254  // (Not officially part of the API)
255  static void drawBitmap(int16_t x, int16_t y,
256  const uint8_t *bitmap, const uint8_t *mask,
257  uint8_t w, uint8_t h, uint8_t draw_mode);
258 };
259 
260 #endif
SpritesCommon.h
Common header file for sprite functions.
Sprites::drawPlusMask
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.
Definition: Sprites.cpp:30
Sprites::drawErase
static void drawErase(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame)
"Erase" a sprite.
Definition: Sprites.cpp:20
Sprites::drawExternalMask
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.
Definition: Sprites.cpp:9
Sprites::drawOverwrite
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.
Definition: Sprites.cpp:15
Arduboy2.h
The Arduboy2Base and Arduboy2 classes and support objects and definitions.
Sprites::drawSelfMasked
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.
Definition: Sprites.cpp:25
Sprites
A class for drawing animated sprites from image and mask bitmaps.
Definition: Sprites.h:76