[Updated] Backgrounds to display the desired portion of the image, [Added] Start of the Game class

This commit is contained in:
Ninjaws
2024-12-09 22:29:08 +01:00
parent 76dd80d3a3
commit cbf6e658ea
15 changed files with 323 additions and 143 deletions
+44
View File
@@ -0,0 +1,44 @@
#ifndef TEXTURE_WRAPPER_H
#define TEXTURE_WRAPPER_H
#include "raylib.h"
class TextureWrapper {
public:
TextureWrapper(Texture2D texture, Vector2 size = {32,32}, Vector2 position = {0,0}, Rectangle sourceRect = {0,0,100,100}) {
this->texture = texture;
this->size = size;
this->position = position;
}
~TextureWrapper() {
}
Texture2D getTexture() {
return this->texture;
}
Rectangle getSourceRect(){
return this->sourceRect;
}
Vector2 getSize() {
return this->size;
}
Vector2 getPosition() {
return this->position;
}
void setSourceRect(Rectangle rect) {
this->sourceRect = rect;
}
private:
Texture2D texture;
Rectangle sourceRect;
Vector2 size;
Vector2 position;
};
#endif