Rune Engine  Version 0.2.7-alpha
Documentation for how to make games using the Rune Engine.
objectAnimation.h
1 
10 #ifndef OBJECT_ANIMATION_HEADER_DEFINED
11 #define OBJECT_ANIMATION_HEADER_DEFINED
12 
13 #include "core.h"
14 #include <string>
15 #include <Events\clock.h>
16 #include <Renderer\texture.h>
17 
18 namespace rune{
19 
20 class RUNE_ENGINE ObjectAnimation
21 {
22 private:
23  int m_frameHeight;
24  int m_frameWidth;
25  int m_numFrames;
26  int m_frameRate;
27  int m_currentFrame;
28  int m_startFrame;
29 
30  rune::Clock m_animationClock;
31 
32  Texture m_animationSheet;
33 
34 public:
38  ObjectAnimation(int frameWidth, int startFrame, int numFrames, int frameRate);
40  void setFrameRate(int frameRate);
42  int getFrameRate(void);
44  void setFrameWidth(int frameWidth);
46  int getFrameWidth(void);
48  void setFrameHeight(int frameHeight);
50  int getFrameHeight(void);
52  void setNumFrames(int numFrames);
54  int getNumFrames(void);
56  void setSheet(std::string const& filePath, unsigned int drawMode);
58  Texture* getSheet(void);
60  int getCurrentFrame(void);
62  void setCurrentFame(int);
64  void incCurrentFrame(void);
66  float getAnimationDuration(void);
68  int getStartFrame();
70  void setStartFrame(int startFrame);
71 
72 };
73 }
74 
75 #endif
rune::ObjectAnimation
Class responsible for managing sprite animations and updating which frame of the animation is to be s...
Definition: objectAnimation.h:21
rune
The main namespace to be used for interfacing with the engine.
Definition: animator.h:21
rune::Texture
A texture that can be applied to drawable objects.
Definition: texture.h:23
rune::Clock
A clock that can be used to tell how much time has passed.
Definition: clock.h:19