getFrameTime

This commit is contained in:
2025-09-03 16:02:48 +03:00
parent 18e03b1f26
commit 3a46538696

12
Tween.h
View File

@ -2,6 +2,8 @@
#include "Easing.h" #include "Easing.h"
#include "TimeWarp.h" #include "TimeWarp.h"
#include <functional>
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// EASING HELPERS // EASING HELPERS
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -167,6 +169,8 @@ public:
frameTime = 1000 / fps; frameTime = 1000 / fps;
} }
uint16_t getFrameTime() const { return frameTime; }
float getFrom() const { float getFrom() const {
return from; return from;
} }
@ -255,7 +259,7 @@ class AnimationChain : public TweenListener {
chainPlaying = true; chainPlaying = true;
launchCurrent(); launchCurrent();
Serial.printf("Chain start [%d]\n", currentIndex); // Serial.printf("Chain start [%d]\n", currentIndex);
} }
void stop() { void stop() {
@ -278,6 +282,8 @@ class AnimationChain : public TweenListener {
return from == to; return from == to;
} }
Tween& getTween() { return tween; }
//------------------------------------------------------------------ //------------------------------------------------------------------
// STATE // STATE
//------------------------------------------------------------------ //------------------------------------------------------------------
@ -298,10 +304,10 @@ class AnimationChain : public TweenListener {
void onTweenFinished(Tween& /*t*/) override { void onTweenFinished(Tween& /*t*/) override {
++currentIndex; ++currentIndex;
if (currentIndex < animations.size()) { if (currentIndex < animations.size()) {
Serial.printf("Chain next [%d]\n", currentIndex); // Serial.printf("Chain next [%d]\n", currentIndex);
launchCurrent(); launchCurrent();
} else { } else {
Serial.printf("Chain stop [x]\n", currentIndex); // Serial.printf("Chain stop [x]\n", currentIndex);
chainPlaying = false; // вся цепочка закончилась chainPlaying = false; // вся цепочка закончилась
} }
} }