30 : m_canvas( 8, 8, m_canvasBuf)
48 for (uint8_t i = 0; i < m_count; i++)
50 SPRITE * sprite = m_sprites[i];
57 updateRegion(sprite->
getRect());
60 sprite->
lx = sprite->
x;
61 sprite->
ly = sprite->
y;
75 uint8_t index = m_count;
80 m_sprites[index] = &sprite;
93 for (uint8_t i=0; i<m_count; i++)
95 if (m_sprites[i] == &sprite)
98 for (uint8_t j=i; j<m_count; j++)
100 m_sprites[j] = m_sprites[j+1];
118 for(uint8_t x = ur.
left; x <= ur.
right; x++)
120 for(uint8_t y = ur.
top; y <= ur.
bottom; y++)
123 for (uint8_t i = 0; i < m_count; i++)
126 m_sprites[i]->y - (y << 3),
127 m_sprites[i]->data );
static const uint8_t SP_ERR_NO_SPACE
No free space for new sprite error.
uint8_t ssd1306_displayWidth()
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.
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