esp32-sk6812/include/Animation/ImageScrollerAnimation.h
Thomas Kolb ae2eb2a25f ImageScrollerAnimation: faster stop by default
Waiting until the text has scrolled by completely is still possible, but
must be activated on object construction by a special argument.
2019-12-24 17:30:52 +01:00

34 lines
597 B
C++

#pragma once
#include <random>
#include <vector>
#include "Animation.h"
#include "Bitmap.h"
class ImageScrollerAnimation : public Animation
{
public:
ImageScrollerAnimation(Fader *fader, Bitmap *image, uint32_t interval = 3, bool finish_scrolling = false);
void loop(uint64_t frame) override;
void stop(void) override
{
m_stopping = true;
}
void reset(void) override;
private:
Bitmap m_image;
int32_t m_startIdx;
uint32_t m_interval;
bool m_finishScrolling;
bool m_stopping;
};