-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRenderable.h
63 lines (59 loc) · 2.9 KB
/
Renderable.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//Renderable.h
#ifndef NEOOBJECTS_RENDERABLE_H
#define NEOOBJECTS_RENDERABLE_H
#include "Texture.h"
#include "Animation.h"
namespace sdlObjects {
namespace Color {
static const int Idle = 0;
static const int Hovered = 1;
static const int Disabled = 2;
}
class Renderable {
//Members
protected:
float BonusDuration;
Animation *Animation;
sdlObjects::Texture *Texture;
int AnimationDuration, AnimationProgress, AnimationTile, AnimationTileProgress, AnimationQueue, Color[4], HoverColor[4], IdleColor[4], DisabledColor[4], Tile;
std::string Animationset, TextureID;
std::vector<int> EventQueue;
//Access Methods
public:
Renderable();
~Renderable();
bool AnimationIsDone();
sdlObjects::Animation *GetAnimation();
int GetAnimationDuration();
void GetAnimationProgress(int &AnimationProgress, int &AnimationTile, int &AnimationTileProgress, float &BonusDuration);
std::string GetAnimationset();
int GetAnimationQueue();
int *GetColor(int ColorMode = -1);
sdlObjects::Texture *GetTexture();
int GetTile();
std::string GetTextureID();
int HandleEvents();
//Process Methods
public:
void ProcessAnimation();
void PushAnimation(int Animation);
void RenderAsArea(std::vector< std::vector<int> > &TileMap, float TargetX, float TargetY, float Width = 0, float Height = 0, sdlObjects::Texture *Texture = NULL);
void RenderAsDialog(float TargetX, float TargetY, int Width = 0, int Height = 0, sdlObjects::Texture *Texture = NULL);
void RenderAsTexture(float TargetX, float TargetY, int Width = 0, int Height = 0, float ClipWidth = 1.0f, float ClipHeight = 1.0f, float ClipX = 0.f, float ClipY = 0.f, sdlObjects::Texture *Texture = NULL, bool OverrideColour = false);
void ResetAnimation();
void SetAnimation(sdlObjects::Animation *Animation);
void SetAnimationDuration(int AnimationDuration);
void SetAnimationProgress(int AnimationProgress, int AnimationTile, int AnimationTileProgress, float BonusDuration);
void SetAnimationset(std::string Animationset);
void SetColor(int ColorMode);
void SetHoverColor(int Color[4]);
void SetIdleColor(int Color[4]);
void SetTile(int Tile);
void SetTexture(sdlObjects::Texture *Texture);
void SetTextureID(std::string TextureID);
void SetTransparency(float Transparency);
protected:
void Render(sdlObjects::Texture *Texture, float TargetX, float TargetY, float Width = 0, float Height = 0, int Tile = 0, float ClipWidth = 1.0f, float ClipHeight = 1.0f, float ClipX = 0.f, float ClipY = 0.f);
};
}
#endif