From 23284accc56c71f3e293fc9ac0c923988ce4ab6a Mon Sep 17 00:00:00 2001 From: Boutade Date: Tue, 15 Oct 2019 11:39:17 -0500 Subject: on-complete extensions --- animise.lisp | 8 +++++++- tweening.lisp | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/animise.lisp b/animise.lisp index 9f2eb0c..232a6c1 100644 --- a/animise.lisp +++ b/animise.lisp @@ -94,7 +94,12 @@ (make-instance 'tween :target (list 0) :start-time start :duration duration :accessor 'car :end-val duration :rounding nil)) -(defun animate (target acc end &key (start 0) (ease #'linear) (rounding t) (duration 1000)) +(defun animate (target acc end &key + (start 0) + (ease #'linear) + (rounding t) + on-complete + (duration 1000) ) (make-instance 'tween :target target :start-time start @@ -102,6 +107,7 @@ :end-val end :ease-fn ease :rounding rounding + :on-complete on-complete :duration duration)) (defun in-sequence (t1 &rest tws) diff --git a/tweening.lisp b/tweening.lisp index bc9f37e..df9b398 100644 --- a/tweening.lisp +++ b/tweening.lisp @@ -58,7 +58,7 @@ ((:sine-in-out :sinusoidal-in-out) #'sinusoidal-in-out) ((:sine-out :sinusoidal-out ) #'sinusoidal-out))) -(defun animating (&key (by :none) the of to for at) +(defun animating (&key (by :none) the of to for at before) "A wrapper around ANIMATE that is aware of any default values defined in the the most recently enclosing form. @@ -88,6 +88,7 @@ the to :start (or at (when-bound *start-time*) 0) + :on-complete before :ease (if (functionp by) by (keyword->ease-fn by)) :duration (or for (when-bound *duration*) 0))) -- cgit v1.2.3