aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Sprite.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/api/Sprite.h')
-rw-r--r--src/crepe/api/Sprite.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/crepe/api/Sprite.h b/src/crepe/api/Sprite.h
index 74a55d4..89f9121 100644
--- a/src/crepe/api/Sprite.h
+++ b/src/crepe/api/Sprite.h
@@ -1,6 +1,7 @@
#pragma once
#include <memory>
+#include <sys/types.h>
#include "../Component.h"
@@ -62,6 +63,19 @@ public:
//! Order within the sorting layer
uint8_t order_in_layer = 0;
+ //! width in world units
+ int width = 0;
+ //! height in world units
+ int height = 0;
+
+ /**
+ * \aspect_ratio ratio of the img so that scaling will not become weird
+ *
+ * cannot be const because if Animator component is addded then ratio becomes scuffed and
+ * does it need to be calculated again in the Animator
+ */
+ double aspect_ratio;
+
public:
/**
* \brief Gets the maximum number of instances allowed for this sprite.
@@ -82,7 +96,7 @@ private:
friend class AnimatorSystem;
//! Render area of the sprite this will also be adjusted by the AnimatorSystem if an Animator
- // object is present in GameObject
+ // object is present in GameObject. this is in sprite pixels
Rect sprite_rect;
};