From e6e83f5270aeb41ffd476840b8fed04ebe8b0925 Mon Sep 17 00:00:00 2001 From: Boutade Date: Sun, 6 Oct 2019 17:54:33 -0500 Subject: example 3 --- README.org | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'README.org') diff --git a/README.org b/README.org index 1379aba..da10864 100644 --- a/README.org +++ b/README.org @@ -41,7 +41,7 @@ And here is what the above looks like [[.images/animise-eg-3.gif]] -*** Another example +*** More Examples [[.images/eg1.gif]] @@ -78,3 +78,30 @@ Then to update each of the animations `anim` and `other-anim`, the above calls #+end_src before the start of the rendering step. + +[[.images/wavy.gif]] + +The code is not quite as nice for this one, but not too bad: + +#+begin_src lisp + + (let* ((animise::*duration* 1000) + (rects (loop :for y :from 0 :to 48 + :collect (sdl2:make-rect 1 (* y 8) 30 8))) + + (out-anims (apply #'as-group + (loop :for (r . rest) :on rects + :collect (animating :the 'sdl2:rect-x + :of r :to 620 :by :cubing-in-out + :at (1+ (* 100 (length rest))))))) + (in-anims (apply #'as-group + (loop :for (r . rest) :on rects + :collect (animating :the 'sdl2:rect-x + :of r :to 1 :by :cubing-in-out + :at (1+ (* 100 (length rest))))))) + (anim (funcall #'in-sequence out-anims in-anims))) + + (setf (loop-mode anim) :looping) + + +#+end_src -- cgit v1.2.3