From 519ec1ace24108e0685b5adae5c3edd258c21091 Mon Sep 17 00:00:00 2001 From: DashyFox Date: Mon, 4 Mar 2024 09:29:04 +0300 Subject: [PATCH] hide dtTick --- Tween.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Tween.h b/Tween.h index c4cf46f..4e51b7c 100644 --- a/Tween.h +++ b/Tween.h @@ -50,6 +50,12 @@ private: float progress; bool isPlayingF; + void dtTick() { + uint32_t loopStartTime = millis(); + dt = (loopStartTime - oldMillis) / 1000.0; + oldMillis = loopStartTime; + } + public: void update() { if (!isPlayingF || easing == nullptr) return; @@ -63,11 +69,7 @@ public: } float current; - void dtTick() { - uint32_t loopStartTime = millis(); - dt = (loopStartTime - oldMillis) / 1000.0; - oldMillis = loopStartTime; - } + void start(float from, float to, uint16_t duration, eFunc easing) { if (from == to) { return; }