mirror of
https://github.com/Lemonochrme/clover.git
synced 2025-06-08 08:40:50 +02:00
27 lines
No EOL
616 B
C++
27 lines
No EOL
616 B
C++
#include "../Screen.hpp"
|
|
#include "SpriteBox.hpp"
|
|
|
|
using namespace Display;
|
|
|
|
SpriteBox::SpriteBox()
|
|
:Box(StyleHeight::UNDEFINED,0)
|
|
{}
|
|
|
|
SpriteBox::SpriteBox(unsigned char *sprite, uint16_t width, uint16_t height, u8g2_uint_t x, u8g2_uint_t y)
|
|
:Box(StyleHeight::TOP,0)
|
|
, _sprite(sprite)
|
|
, _width(width)
|
|
, _height(height)
|
|
, _x(x)
|
|
, _y(y)
|
|
{}
|
|
|
|
void SpriteBox::Update(std::any data)
|
|
{
|
|
_sprite = std::any_cast<unsigned char*>(data);
|
|
}
|
|
|
|
void SpriteBox::Display(size_t size, size_t position, u8g2_uint_t offsetY)
|
|
{
|
|
Screen::GetInstance().getScreen().drawXBM(_x,_y,_width,_height,_sprite);
|
|
} |