25 : m_canvas( 8, 8, m_canvasBuf)
43 for (uint8_t i = 0; i < m_count; i++)
45 SPRITE * sprite = m_sprites[i];
52 updateRegion(sprite->
getRect());
55 sprite->
lx = sprite->
x;
56 sprite->
ly = sprite->
y;
70 uint8_t index = m_count;
75 m_sprites[index] = &sprite;
88 for (uint8_t i=0; i<m_count; i++)
90 if (m_sprites[i] == &sprite)
93 for (uint8_t j=i; j<m_count; j++)
95 m_sprites[j] = m_sprites[j+1];
113 for(uint8_t x = ur.
left; x <= ur.
right; x++)
115 for(uint8_t y = ur.
top; y <= ur.
bottom; y++)
118 for (uint8_t i = 0; i < m_count; i++)
121 m_sprites[i]->y - (y << 3),
122 m_sprites[i]->data );
static const uint8_t SP_ERR_NO_SPACE
No free space for new sprite error.
void drawSpritePgm(uint8_t x, uint8_t y, const uint8_t sprite[])
NanoCanvas m_canvas
Canvas used to draw sprites to avoid flickering.
uint8_t ssd1306_displayHeight()
static const uint8_t MAX_SPRITES
Defines max sprites number supported by SpritePool.
void remove(SPRITE &sprite)
uint8_t add(SPRITE &sprite)
uint8_t y
draw position Y on the screen
SSD1306_RECT getUpdateRect() const
uint8_t x
draw position X on the screen
SSD1306_RECT m_rect
Rectangle, which specifies part of the display, used by the sprites.
uint8_t ssd1306_displayWidth()
void blt(uint8_t x, uint8_t y)
SSD1306_RECT getRect() const
uint8_t lx
last draw position X on the screen
virtual void drawBlock(uint8_t blockColumn, uint8_t blockRow)
uint8_t ly
last draw position Y on the screen
SSD1306_RECT getLRect() const