TurtleBrains  0.3.5
High quality, portable, C++ framework for rapid 2D game development.
tbx_scale_behaviors.hpp
1 
9 #ifndef TurtleBrains_ScaleBehaviors_hpp
10 #define TurtleBrains_ScaleBehaviors_hpp
11 
12 #include <turtle_brains/express/behaviors/tbx_tweening_behavior.hpp>
13 #include <turtle_brains/game/tb_entity_behavior_interface.hpp>
14 #include <turtle_brains/game/tb_game_timer.hpp>
15 #include <turtle_brains/math/tb_vector.hpp>
16 
17 namespace TurtleBrainsExpress
18 {
19  namespace Behaviors
20  {
21 
27  {
28  public:
36  ScaleToBehavior(tbGame::Entity& entity, const float desiredScale, const float scaleSpeed);
37 
45  ScaleToBehavior(tbGame::Entity& entity, const tbMath::Vector2& desiredScale, const float scaleSpeed);
46 
50  virtual ~ScaleToBehavior(void);
51 
55  virtual void OnSimulate(void) override;
56 
57  private:
58  const tbMath::Vector2 mDesiredScale;
59  const float mScaleSpeed;
60  };
61 
62 
67  class ScaleTweenBehavior : public TweeningBehavior<tbMath::Vector2>
68  {
69  public:
79  ScaleTweenBehavior(tbGame::Entity& entity, const float desiredScale, const tbGame::GameTimer& time, const TweenMode& tweenMode);
80 
91  ScaleTweenBehavior(tbGame::Entity& entity, const tbMath::Vector2& desiredScale, const tbGame::GameTimer& time, const TweenMode& tweenMode);
92 
96  virtual ~ScaleTweenBehavior(void);
97 
102  virtual void OnRemove(void) override;
103 
111  virtual void OnResume(void) override;
112 
117  virtual void OnSimulate(void) override;
118  };
119 
120  }; /* namespace Behaviors */
121 }; /* namespace TurtleBrainsExpress */
122 
124 
125 #endif /* TurtleBrains_ScaleBehaviors_hpp */
Definition: tb_vector.hpp:48
Definition: tb_entity.hpp:46
Definition: tb_entity_behavior_interface.hpp:24
A collection of objects and functions to express games quickly.
Definition: tbx_tweening_behavior.hpp:26
Definition: tbx_scale_behaviors.hpp:67
Contains high-level objects to control the entities in game worlds.
Definition: tbx_scale_behaviors.hpp:26
ScaleToBehavior(tbGame::Entity &entity, const float desiredScale, const float scaleSpeed)
ScaleTweenBehavior(tbGame::Entity &entity, const float desiredScale, const tbGame::GameTimer &time, const TweenMode &tweenMode)
Definition: tb_game_timer.hpp:25