diff options
Diffstat (limited to 'src/crepe/api/Sprite.h')
-rw-r--r-- | src/crepe/api/Sprite.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/crepe/api/Sprite.h b/src/crepe/api/Sprite.h index ef65f64..3565bed 100644 --- a/src/crepe/api/Sprite.h +++ b/src/crepe/api/Sprite.h @@ -42,10 +42,10 @@ public: FlipSettings flip; //! Layer sorting level of the sprite - const int sorting_in_layer = 0; + int sorting_in_layer = 0; //! Order within the sorting layer - const int order_in_layer = 0; + int order_in_layer = 0; /** * \brief width and height of the sprite in game units @@ -110,16 +110,21 @@ private: */ float aspect_ratio = 0; -public: - struct Mask { - unsigned w = 0; - unsigned h = 0; - unsigned x = 0; - unsigned y = 0; + struct Rect { + int w = 0; + int h = 0; + int x = 0; + int y = 0; }; //! Render area of the sprite this will also be adjusted by the AnimatorSystem if an Animator // object is present in GameObject. this is in sprite pixels - Mask mask; + Rect mask; + +protected: + virtual std::unique_ptr<Component> save() const; + Sprite(const Sprite &) = default; + virtual void restore(const Component & snapshot); + virtual Sprite & operator=(const Sprite &); }; } // namespace crepe |