diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-04 10:56:53 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-04 10:56:53 +0100 |
commit | a11824956b478e356fa684c9d88b980aa22cb19a (patch) | |
tree | d743b0415040d68db4f5cf35b2fc58bab41f0e46 /src/crepe/api/Animator.h | |
parent | 683ae28b81a66f18bbadbe7ae70eb8ddd952c293 (diff) |
implemented feedback, cameraValues need better name?
Diffstat (limited to 'src/crepe/api/Animator.h')
-rw-r--r-- | src/crepe/api/Animator.h | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/crepe/api/Animator.h b/src/crepe/api/Animator.h index 74abd5e..1fe2b6f 100644 --- a/src/crepe/api/Animator.h +++ b/src/crepe/api/Animator.h @@ -18,20 +18,13 @@ class SDLContext; class Animator : public Component { public: struct Data { - //! A reference to the Sprite sheet containing. - Sprite & spritesheet; - //! The maximum number of columns in the sprite sheet. - const int col; - - //! The maximum number of rows in the sprite sheet. - const int row; //! frames per second for animation - int fps; + int fps = 1; //! The current col being animated. - int curr_col; + int curr_col = 0; //! The current row being animated. int curr_row = 0; @@ -113,10 +106,19 @@ public: * This constructor sets up the Animator with the given parameters, and initializes the * animation system. */ - Animator(uint32_t id, const Animator::Data & ctx); + Animator(uint32_t id, Sprite & ss, int max_row, int max_col, const Animator::Data & ctx); ~Animator(); // dbg_trace public: + //! A reference to the Sprite sheet containing. + Sprite & spritesheet; + + //! The maximum number of columns in the sprite sheet. + const int col; + + //! The maximum number of rows in the sprite sheet. + const int row; + Animator::Data data; private: |