4#include "../../Components.h"
6#include "../Animation.h"
7#include "../AnimatorManager.h"
10typedef uint32_t timestamp;
18 std::string animationName =
"";
19 timestamp resumeTime = 0;
42 void update(
float deltaTime)
override
44 if (animationName ==
"Default") {
47 if (
rectangle->flash_animation.hasFinished()) {
48 rectangle->flash_animation.finished =
false;
49 rectangle->flash_animation.times_played = 0;
53 rectangle->flash_animation.advanceFrame(deltaTime);
62 void Play(
const std::string& animName,
int reps = 0)
65 animationName = animName;
66 FlashAnimation& flash_animation = animManager.flash_animations[animationName];
68 flash_animation.total_frames, flash_animation.speed,
70 flash_animation.getSpeedsAsVector(),
71 flash_animation.flashColor,
72 reps ? reps : flash_animation.reps
76 void Play(
const std::string& animName,
TazColor m_destColor,
int reps = 0)
79 animationName = animName;
80 FlashAnimation& flash_animation = animManager.flash_animations[animationName];
82 flash_animation.total_frames, flash_animation.speed,
84 flash_animation.getSpeedsAsVector(),
86 reps ? reps : flash_animation.reps
90 void resetAnimation() {
94 animationName =
"Default";
96 animManager.flash_animations[animationName].total_frames, animManager.flash_animations[animationName].speed,
97 animManager.flash_animations[animationName].type,
98 animManager.flash_animations[animationName].getSpeedsAsVector(),
99 animManager.flash_animations[animationName].flashColor);
102 std::string getPlayName()
104 return animationName;
T & addComponent(TArgs &&... mArgs)
have addScript function
Definition GECS.h:345
Definition PlaneModelRenderer.h:15
Definition RectangleFlashAnimatorComponent.h:14
Rectangle_w_Color * rectangle
also we use MovingAnimator instead of simple Animator so that entities use less memory and we use it ...
Definition RectangleFlashAnimatorComponent.h:17
Definition Rectangle_w_Color.h:6
Definition AnimatorManager.h:10
Definition FlashAnimation.h:10