From f16fed3d50fd3d56deb46a3d4641a81460e389de Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 12 Dec 2018 09:20:10 -0500 Subject: Update Chickadee manual and home page for 0.3.0. Better late than never! --- manuals/chickadee/Tweening.html | 132 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 manuals/chickadee/Tweening.html (limited to 'manuals/chickadee/Tweening.html') diff --git a/manuals/chickadee/Tweening.html b/manuals/chickadee/Tweening.html new file mode 100644 index 0000000..3e344df --- /dev/null +++ b/manuals/chickadee/Tweening.html @@ -0,0 +1,132 @@ + + + + + + +Tweening (The Chickadee Game Toolkit) + + + + + + + + + + + + + + + + + + + + +
+

+Next: , Previous: , Up: Scripting   [Contents][Index]

+
+
+ +

2.4.3 Tweening

+ +

Tweening is the process of transitioning something from an initial +state to a final state over a pre-determined period of time. In other +words, tweening is a way to create animation. The tween +procedure can be used within any script like so: +

+
+
(define x 0)
+(script
+  ;; 0 to 100 in 60 ticks of the agenda.
+  (tween 60 0 100 (lambda (y) (set! x y))))
+
+ +
+
Procedure: tween duration start end proc [#:step 1 #:ease smoothstep #:interpolate lerp]
+

Transition a value from start to end over duration, +sending each succesive value to proc. step controls the +amount of time between each update of the animation. +

+

To control how the animation goes from the initial to final state, an +“easing” procedure may be specified. By default, the +smoothstep easing is used, which is a more pleasing default +than a simplistic linear function. See Easings for a complete list +of available easing procedures. +

+

The interpolate procedure computes the values in between +start and end. By default, linear interpolation (“lerp” +for short) is used. +

+ + + + + + -- cgit v1.2.3