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 "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; // вся цепочка закончилась
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user