mirror of
https://github.com/Show-maket/Tween.git
synced 2025-09-13 11:22:49 +00:00
getFrameTime
This commit is contained in:
12
Tween.h
12
Tween.h
@ -2,6 +2,8 @@
|
||||
#include "Easing.h"
|
||||
#include "TimeWarp.h"
|
||||
|
||||
#include <functional>
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// EASING HELPERS
|
||||
//----------------------------------------------------------------------
|
||||
@ -167,6 +169,8 @@ public:
|
||||
frameTime = 1000 / fps;
|
||||
}
|
||||
|
||||
uint16_t getFrameTime() const { return frameTime; }
|
||||
|
||||
float getFrom() const {
|
||||
return from;
|
||||
}
|
||||
@ -255,7 +259,7 @@ class AnimationChain : public TweenListener {
|
||||
chainPlaying = true;
|
||||
launchCurrent();
|
||||
|
||||
Serial.printf("Chain start [%d]\n", currentIndex);
|
||||
// Serial.printf("Chain start [%d]\n", currentIndex);
|
||||
}
|
||||
|
||||
void stop() {
|
||||
@ -278,6 +282,8 @@ class AnimationChain : public TweenListener {
|
||||
return from == to;
|
||||
}
|
||||
|
||||
Tween& getTween() { return tween; }
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// STATE
|
||||
//------------------------------------------------------------------
|
||||
@ -298,10 +304,10 @@ class AnimationChain : public TweenListener {
|
||||
void onTweenFinished(Tween& /*t*/) override {
|
||||
++currentIndex;
|
||||
if (currentIndex < animations.size()) {
|
||||
Serial.printf("Chain next [%d]\n", currentIndex);
|
||||
// Serial.printf("Chain next [%d]\n", currentIndex);
|
||||
launchCurrent();
|
||||
} else {
|
||||
Serial.printf("Chain stop [x]\n", currentIndex);
|
||||
// Serial.printf("Chain stop [x]\n", currentIndex);
|
||||
chainPlaying = false; // вся цепочка закончилась
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user