pitrix/src/effect_animation.cpp

26 lines
606 B
C++

#include "effect_animation.h"
#include "functions.h"
AnimationEffect::AnimationEffect(const char* name, uint32_t bg, int x, int y) {
this->xOffset = x;
this->yOffset = y;
this->animation = new Animation(name, window);
this->animation->setBgColor(bg);
this->animation->setOffsets(this->xOffset, this->yOffset);
}
AnimationEffect* AnimationEffect::setFgColor(uint32_t c) {
animation->setFgColor(c);
return this;
}
AnimationEffect::~AnimationEffect() {
delete this->animation;
}
void AnimationEffect::loop() {
this->animation->drawFrame();
this->animation->advance();
}