From 7cc9079a59d6bb0051f2cad6264d802ba8bc238e Mon Sep 17 00:00:00 2001 From: Yota Hamada Date: Sat, 24 Jun 2023 19:02:20 +0900 Subject: [PATCH] add SetOnLoop (#18) --- animation.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/animation.go b/animation.go index 7104a0d..63591b9 100644 --- a/animation.go +++ b/animation.go @@ -183,6 +183,11 @@ func (anim *Animation) Clone() *Animation { return &new } +// SetOnLoop sets the callback function which representing +func (anim *Animation) SetOnLoop(onLoop OnLoop) { + anim.onLoop = onLoop +} + func seekFrameIndex(intervals []time.Duration, timer time.Duration) int { high, low, i := len(intervals)-2, 0, 0 for low <= high {