From f440f7fb52ca62715504e4a3c7076456de40f7b8 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 21 Nov 2018 08:39:28 +0800 Subject: =?UTF-8?q?*=E6=9B=B4=E6=96=B0=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/graphics/animations/je_animator.h | 53 ++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/libjin/graphics/animations/je_animator.h (limited to 'src/libjin/graphics/animations/je_animator.h') diff --git a/src/libjin/graphics/animations/je_animator.h b/src/libjin/graphics/animations/je_animator.h new file mode 100644 index 0000000..72d9021 --- /dev/null +++ b/src/libjin/graphics/animations/je_animator.h @@ -0,0 +1,53 @@ +#ifndef __JE_ANIMATOR_H__ +#define __JE_ANIMATOR_H__ + +#include "je_animation.h" + +namespace JinEngine +{ + namespace Graphics + { + namespace Animations + { + + class Animator + { + public: + Animator(); + + void play(); + + void pause(); + + void resume(); + + void update(float dt); + + void rewind(); + + void render(float x, float y, float sx, float sy, float r); + + void setAnimation(const Animation* anim); + + void forceToFrame(uint index); + + private: + const Animation* mAnimation; + + uint mIndex; + + float mTick; + + bool mIsActive; + + float mSpeed; + + bool mLoop; + + }; + + } + } +} + +#endif \ No newline at end of file -- cgit v1.1-26-g67d0