From 75e6ab8ddca6ba3a2049c1d3c75d56ba2d3bb2a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Tue, 2 Jul 2024 23:35:51 +0200 Subject: [PATCH] can also delay on chains --- src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 6d5dc67..90c278c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -260,6 +260,13 @@ impl EasingChainComponent { self.0 = tmp; self } + + /// Adds a delay before triggering the easing. + pub fn delay(mut self, duration: Duration) -> Self { + self.0[0].paused = true; + self.0[0].timer = Timer::new(duration, TimerMode::Once); + self + } } /// Trait marking components that can be eased