Added AnimationEffect::Blinker to quickly create a blinking sprite effect from an image file.

This commit is contained in:
2020-04-29 20:17:34 +02:00
parent 402d7f5d75
commit 1707084299
3 changed files with 28 additions and 5 deletions

View File

@ -11,12 +11,14 @@ private:
const char* name;
uint16_t xOffset;
uint16_t yOffset;
unsigned long _last_blink_at;
uint16_t _blink_freq;
public:
AnimationEffect(const char* name) : AnimationEffect(name, 0x000000, 0, 0) {}
AnimationEffect(const char* name, uint32_t bg_color) : AnimationEffect(name, bg_color, 0, 0) {}
AnimationEffect(const char* name, uint32_t bg_color, int x, int y);
AnimationEffect(const char* name, uint32_t bg_color=0x000000, int x=0, int y=0);
static AnimationEffect* Blinker(const char* name, uint16_t interval, uint32_t color, uint32_t background_color=0x000000);
~AnimationEffect();
AnimationEffect* setFgColor(uint32_t c);
AnimationEffect* setBlinkFrequency(uint16_t);
void loop(uint16_t ms);
String get_name() override;
};