aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/graphics/animations/je_animation.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-11-21 08:39:28 +0800
committerchai <chaifix@163.com>2018-11-21 08:39:28 +0800
commitf440f7fb52ca62715504e4a3c7076456de40f7b8 (patch)
tree16d6bbaa9a6d42c6c57c193556ea0e1a881128a0 /src/libjin/graphics/animations/je_animation.h
parent9474767c68c48eff2618df80433b0b81ebf529c6 (diff)
*更新动画
Diffstat (limited to 'src/libjin/graphics/animations/je_animation.h')
-rw-r--r--src/libjin/graphics/animations/je_animation.h86
1 files changed, 9 insertions, 77 deletions
diff --git a/src/libjin/graphics/animations/je_animation.h b/src/libjin/graphics/animations/je_animation.h
index 4c2fd64..1c8a885 100644
--- a/src/libjin/graphics/animations/je_animation.h
+++ b/src/libjin/graphics/animations/je_animation.h
@@ -21,98 +21,30 @@ namespace JinEngine
public:
Animation();
- ///
- ///
- ///
void addFrame(const Sprite* frame);
- ///
- ///
- ///
void addFrames(const std::vector<Sprite*>& frames);
- ///
- ///
- ///
- void update(float dt);
-
- ///
- ///
- ///
- void pause();
-
- ///
- ///
- ///
- void resume();
-
- ///
- /// Force rewind.
- ///
- void rewind();
-
- ///
- ///
- ///
+ void setLoop(bool loop);
+
void setSpeed(float speed);
- ///
- ///
- ///
- void setLoop(bool isLoop);
-
- ///
- /// Get current frame index.
- ///
- uint getCurrentFrameIndex();
-
- ///
- ///
- ///
- const Sprite* getCurrentFrame();
-
- ///
- /// Set current frame index.
- ///
- /// @param frame Current frame to play.
- ///
- void setCurrentFrame(uint frame);
-
- ///
- ///
- ///
- void render(float x, float y, float sx, float sy, float r);
-
- ///
- ///
- ///
- Animation clone();
+ bool isLoop() const;
- private:
+ float getSpeed() const;
- void next();
+ uint getFrameCount() const;
- ///
- /// Key frames.
- ///
- std::vector<const Sprite*> mFrames;
+ const Sprite* getFrame(uint index) const;
- ///
- /// Animation playing speed.
- ///
- float mSpeed;
+ private:
- ///
- ///
- ///
- float mTick;
+ std::vector<const Sprite*> mFrames;
- uint mIndex;
+ float mSpeed;
float mLoop;
- bool mActive;
-
};
} // namespace Animations