Rune Engine  Version 0.2.7-alpha
Documentation for how to make games using the Rune Engine.
animator.h
1 #pragma once
2 
11 #ifndef ANIMATION_CONTROLLER_H_DEFINED
12 #define ANIMATION_CONTROLLER_H_DEFINED
13 
14 #include "core.h"
15 #include <Entities/gameObject.h>
16 #include <Entities/component.h>
17 #include "objectAnimation.h"
18 #include <Renderer\sprite.h>
19 #include <unordered_map>
20 
21 namespace rune{
22 
23 class RUNE_ENGINE Animator : public Component
24 {
25 
26 private:
27 
28  std::unordered_map<std::string, rune::ObjectAnimation*> m_animations;
29  rune::Sprite* spriteParent;
30 
31 public:
33  Animator();
35  void start() override;
37  void playAnimation(std::string const& animationName);
39  void addAnimation(std::string const& animationName, int frameWidth, int startFrame, int numFrames, int frameRate, std::string const& fileName);
41  void addAnimation(std::string const& animationName, int frameWidth, int numFrames, int frameRate, std::string const& fileName);
43  ObjectAnimation* getAnimation(std::string const& name);
44 
45 
46 
47 };
48 
49 }
50 
51 #endif
rune::Animator
This class is used to animate a rune::GameObject.
Definition: animator.h:24
rune::Component
A component of a rune::GameObject, this class is used to add functionality to a object in the game wo...
Definition: component.h:23
rune::ObjectAnimation
Class responsible for managing sprite animations and updating which frame of the animation is to be s...
Definition: objectAnimation.h:21
rune::Sprite
A sprite that can be given a texture and animated.
Definition: sprite.h:25
rune
The main namespace to be used for interfacing with the engine.
Definition: animator.h:21