SUNENGINE 0.0.2
A simple and bright C++ game engine.
 
Loading...
Searching...
No Matches
SUNENGINESprite.h
1#ifndef SUNENGINESprite_H
2#define SUNENGINESprite_H
3
4#include "AzulCore.h"
5
6class Camera;
7
16{
17public:
18 SUNENGINESprite() = default;
19 SUNENGINESprite(const SUNENGINESprite&) = delete;
20 SUNENGINESprite& operator=(const SUNENGINESprite&) = delete;
21 ~SUNENGINESprite();
22
28 SUNENGINESprite(std::string key);
29
36 void SetOrigin(float x, float y);
37
44 void SetPosition(float x, float y);
45
51 void SetAngleRadians(float rad);
52
58 void SetAngleDegrees(float deg);
59
66 void SetScaleFactor(float x, float y);
67
74 void SetScalePixel(float x, float y);
75
81 float GetWidth();
82
88 float GetHeight();
89
95 float GetAngle();
96
102 void Render(Camera* cam);
103
104private:
108 GraphicsObject_Sprite* pSprite;
109
113 Matrix trans;
114
118 Matrix rot;
119
123 Matrix scale;
124
128 float posX;
129
133 float posY;
134
138 float angle;
139
143 float scaleX;
144
148 float scaleY;
149
154};
155
156#endif
Represents a sprite in the SUNENGINE.
Definition Sprites/SUNENGINESprite.h:16
void SetAngleRadians(float rad)
Sets the angle of the sprite in radians.
void UpdateWorld()
Updates the world transformation matrix for the sprite.
float GetAngle() const
Gets the angle of the sprite.
Definition Sprites/SUNENGINESprite.cpp:72
Matrix trans
Transformation matrix for the sprite.
Definition Sprites/SUNENGINESprite.h:141
Matrix rot
Rotation matrix for the sprite.
Definition Sprites/SUNENGINESprite.h:146
float angle
The angle of the sprite.
Definition Sprites/SUNENGINESprite.h:166
float posX
The x-coordinate of the sprite's position.
Definition Sprites/SUNENGINESprite.h:156
SUNENGINESprite(std::string key)
Constructor for SUNENGINESprite with a key.
void SetScaleFactor(float x, float y)
Sets the scale factor of the sprite.
Matrix scale
Scale matrix for the sprite.
Definition Sprites/SUNENGINESprite.h:151
void SetOrigin(float x, float y)
Sets the origin of the sprite.
void SetPosition(float x, float y)
Sets the position of the sprite.
float scaleX
The scale factor in the x direction.
Definition Sprites/SUNENGINESprite.h:171
float GetWidth() const
Gets the width of the sprite.
Definition Sprites/SUNENGINESprite.cpp:62
float scaleY
The scale factor in the y direction.
Definition Sprites/SUNENGINESprite.h:176
float posY
The y-coordinate of the sprite's position.
Definition Sprites/SUNENGINESprite.h:161
GraphicsObject_Sprite * pSprite
Pointer to the GraphicsObject_Sprite associated with this sprite.
Definition Sprites/SUNENGINESprite.h:136
void Render()
Renders the sprite using the specified camera.
Definition Sprites/SUNENGINESprite.cpp:87
float GetHeight() const
Gets the height of the sprite.
Definition Sprites/SUNENGINESprite.cpp:67
void SetScalePixel(float x, float y)
Sets the scale of the sprite in pixels.
void SetAngleDegrees(float deg)
Sets the angle of the sprite in degrees.