2013-06-02 15:08:32 +00:00
|
|
|
#ifndef _ANIMATIONCOMPONENT_H_
|
|
|
|
#define _ANIMATIONCOMPONENT_H_
|
2012-10-17 17:15:58 +00:00
|
|
|
|
2013-06-02 15:08:32 +00:00
|
|
|
#include "../GuiComponent.h"
|
|
|
|
#include "ImageComponent.h"
|
2013-04-08 16:52:40 +00:00
|
|
|
#include <vector>
|
2012-10-17 17:15:58 +00:00
|
|
|
|
2013-06-14 15:48:13 +00:00
|
|
|
#define ANIMATION_TICK_SPEED 16
|
|
|
|
|
2013-06-02 15:08:32 +00:00
|
|
|
class AnimationComponent
|
2012-10-17 17:15:58 +00:00
|
|
|
{
|
|
|
|
public:
|
2013-06-02 15:08:32 +00:00
|
|
|
AnimationComponent();
|
2012-10-17 17:15:58 +00:00
|
|
|
|
|
|
|
void move(int x, int y, int speed);
|
|
|
|
void fadeIn(int time);
|
|
|
|
void fadeOut(int time);
|
|
|
|
|
2013-04-08 16:52:40 +00:00
|
|
|
void update(int deltaTime);
|
|
|
|
|
2013-06-02 15:08:32 +00:00
|
|
|
void addChild(ImageComponent* gui);
|
2013-04-08 16:52:40 +00:00
|
|
|
|
2012-10-17 17:15:58 +00:00
|
|
|
private:
|
2013-04-08 16:52:40 +00:00
|
|
|
unsigned char mOpacity;
|
|
|
|
|
2013-06-02 15:08:32 +00:00
|
|
|
std::vector<ImageComponent*> mChildren;
|
2013-04-08 16:52:40 +00:00
|
|
|
|
2012-10-17 17:15:58 +00:00
|
|
|
void moveChildren(int offsetx, int offsety);
|
|
|
|
void setChildrenOpacity(unsigned char opacity);
|
|
|
|
|
|
|
|
int mFadeRate;
|
|
|
|
int mMoveX, mMoveY, mMoveSpeed;
|
2013-06-14 15:48:13 +00:00
|
|
|
|
|
|
|
int mAccumulator;
|
2012-10-17 17:15:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|