mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-28 00:55:39 +00:00
df78b5352d
Possible now that the opacity logic has been moved to GuiComponent.
37 lines
607 B
C++
37 lines
607 B
C++
#ifndef _ANIMATIONCOMPONENT_H_
|
|
#define _ANIMATIONCOMPONENT_H_
|
|
|
|
#include "../GuiComponent.h"
|
|
#include <vector>
|
|
|
|
#define ANIMATION_TICK_SPEED 16
|
|
|
|
class AnimationComponent
|
|
{
|
|
public:
|
|
AnimationComponent();
|
|
|
|
void move(int x, int y, int speed);
|
|
void fadeIn(int time);
|
|
void fadeOut(int time);
|
|
|
|
void update(int deltaTime);
|
|
|
|
void addChild(GuiComponent* gui);
|
|
|
|
private:
|
|
unsigned char mOpacity;
|
|
|
|
std::vector<GuiComponent*> mChildren;
|
|
|
|
void moveChildren(int offsetx, int offsety);
|
|
void setChildrenOpacity(unsigned char opacity);
|
|
|
|
int mFadeRate;
|
|
int mMoveX, mMoveY, mMoveSpeed;
|
|
|
|
int mAccumulator;
|
|
};
|
|
|
|
#endif
|