diff options
| author | realtradam <[email protected]> | 2022-11-04 16:32:10 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2022-11-04 16:32:10 -0400 |
| commit | 6936cd871bd99f702e6180b169785b814cfa00f3 (patch) | |
| tree | 09025d45372d1c3c73a6ba39b49bf969f8929681 /src/resources.h | |
| parent | 53ef8694998392856c44e7397860e04e2dddac49 (diff) | |
| download | orbital_game-6936cd871bd99f702e6180b169785b814cfa00f3.tar.gz orbital_game-6936cd871bd99f702e6180b169785b814cfa00f3.zip | |
implemented sprites
Diffstat (limited to 'src/resources.h')
| -rw-r--r-- | src/resources.h | 15 |
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); + }; } |
