summaryrefslogtreecommitdiffhomepage
path: root/src/resources.h
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2022-11-04 16:32:10 -0400
committerrealtradam <[email protected]>2022-11-04 16:32:10 -0400
commit6936cd871bd99f702e6180b169785b814cfa00f3 (patch)
tree09025d45372d1c3c73a6ba39b49bf969f8929681 /src/resources.h
parent53ef8694998392856c44e7397860e04e2dddac49 (diff)
downloadorbital_game-6936cd871bd99f702e6180b169785b814cfa00f3.tar.gz
orbital_game-6936cd871bd99f702e6180b169785b814cfa00f3.zip
implemented sprites
Diffstat (limited to 'src/resources.h')
-rw-r--r--src/resources.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/resources.h b/src/resources.h
index eef1883..edc1fec 100644
--- a/src/resources.h
+++ b/src/resources.h
@@ -3,5 +3,18 @@
#include "raylib.h"
namespace Resources {
- Texture useTexture(std::string id);
+ Texture useTexture(std::string id);
+ class Sprite {
+ public:
+ std::string texture_name;
+ Rectangle source_rectangle;
+ Vector2 origin;
+
+ Sprite(std::string texture_name,
+ Rectangle source_rectangle,
+ Vector2 origin = (Vector2){0,0}
+ );
+ void drawPro(Rectangle dest_rectangle, float rotation = 0, Color color = WHITE);
+ void draw(float x, float y, float scale = 1.0, float rotation = 0, Color color = WHITE);
+ };
}