-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsprite.h
43 lines (35 loc) · 949 Bytes
/
sprite.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
#pragma once
#include "graphicsBuffer.h"
#include "Vector2D.h"
class Sprite : public Trackable
{
public:
Sprite();
Sprite(GraphicsBuffer &g);
~Sprite();
//setters
void setHeight(int h);
void setColor(const Color &c);
void setRotation(double theta);
void setOrigin(Vector2D o);
void setWidth(int w);
void setSourceLoc(int x, int y);
void setTexture(GraphicsBuffer *g);
//getters
Color getColor() const;
int getHeight() const;
double getRotation() const;
Vector2D getOrigin() const;
int getTransparency() const;
int getWidth() const;
Vector2D getSourceLoc() const;
GraphicsBuffer *getTexture() const;
protected:
Vector2D mSourceLoc;
Vector2D mOrigin; //used to rotate about a specific point/accomodate for certain graphics libraries that are pedantic about rotations cough SFML cough
int mWidth, mHeight;
double mTheta;
Color mColor;
int mAlpha;
GraphicsBuffer *mTexture;
};