From 0530405899d0399f97ff744eb88cb8674a423821 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 28 Jan 2009 16:44:22 +0000 Subject: [PATCH] [clutter-docs] Update the animation tutorial The Alpha API and usage has been changed by the recent overhaul of the ClutterAlpha class; hence, we need to update the relative documentation in the animation tutorial. --- .../clutter/clutter-animation-tutorial.xml | 82 +++---------------- 1 file changed, 12 insertions(+), 70 deletions(-) diff --git a/doc/reference/clutter/clutter-animation-tutorial.xml b/doc/reference/clutter/clutter-animation-tutorial.xml index c12b64122..b76ecbbc9 100644 --- a/doc/reference/clutter/clutter-animation-tutorial.xml +++ b/doc/reference/clutter/clutter-animation-tutorial.xml @@ -290,67 +290,14 @@ main (int argc, char *argv[]) - A ClutterAlpha is simply a 'function of time' (not a pixel alpha!). It - is created by referencing a source timeline and a function which - produces a value between 0 and %CLUTTER_ALPHA_MAX dependant on the - timeline position. Various prebuilt alpha functions are included - with Clutter these include + A ClutterAlpha is simply a 'function of time' (not a pixel alpha channel!). + It is created by referencing a source timeline and an "easing mode" which + produces a value between -1 and 2 depending on the progress of the + timeline. Clutter provides various easing modes, as described by + the #ClutterAnimationMode enumeration. It is also possible to register + a new animation mode using clutter_alpha_register_func() or to provide + a custom #ClutterAlphaFunc for a specific #ClutterAlpha instance. - - - - - - %CLUTTER_ALPHA_RAMP_INC - Increasing ramp function - - - %CLUTTER_ALPHA_RAMP_DEC - Decreasing ramp function - - - %CLUTTER_ALPHA_RAMP - Full ramp function - - - %CLUTTER_ALPHA_SINE_INC - Increasing sine function - - - %CLUTTER_ALPHA_SINE_DEC - Decreasing sine function - - - %CLUTTER_ALPHA_SINE_HALF - Half sine function - - - %CLUTTER_ALPHA_SINE - Full sine function - - - %CLUTTER_ALPHA_SQUARE - Square waveform ("step") function - - - %CLUTTER_ALPHA_SMOOTHSTEP_INC - Increasing smooth transition step - function - - - %CLUTTER_ALPHA_SMOOTHSTEP_DEC - Decreasing smooth transition step - function - - - %CLUTTER_ALPHA_EXP_INC - Increasing exponential function - - - %CLUTTER_ALPHA_EXP_DEC - Decreasing exponential function - - @@ -369,10 +316,7 @@ main (int argc, char *argv[]) feature of the actor dependant on the Alpha's value. For example a path based behaviour applied to an actor will alter its position along the path dependant on the current alpha value over time. The - actual motion will depend on the chosen #ClutterAlphaFunc - a - #CLUTTER_ALPHA_RAMP_INC making it to move at constant speed along the - path, a #CLUTTER_ALPHA_SINE making it alternate from one end of the - path to the other with non constant speed. + actual motion will depend on the chosen "easing mode". @@ -393,9 +337,9 @@ main (int argc, char *argv[])
The actors position between the path's end points directly correlates to the #ClutterAlpha's current alpha value driving the behaviour. With - the #ClutterAlpha's function set to %CLUTTER_ALPHA_RAMP_INC the actor + the #ClutterAlpha's animation mode set to %CLUTTER_LINEAR the actor will follow the path at a constant velocity, but when changing to - %CLUTTER_ALPHA_SINE_INC the actor initially accelerates before quickly + %CLUTTER_EASE_SINE_IN_OUT the actor initially accelerates before quickly decelerating.
@@ -468,9 +412,7 @@ main (int argc, char *argv[]) clutter_timeline_set_loop (timeline, TRUE); /* Set an alpha func to power the behaviour */ - alpha = clutter_alpha_new_full (timeline, - CLUTTER_ALPHA_SINE, - NULL, NULL); + alpha = clutter_alpha_new_full (timeline, CLUTTER_EASE_SINE_IN_OUT); behave = clutter_behaviour_ellipse_new (alpha, 200, /* center x */ @@ -576,7 +518,7 @@ main (int argc, char *argv[]) ClutterButtonEvent *event, gpointer user_data) { - clutter_actor_animate (actor, CLUTTER_SINE_IN_OUT, 500, + clutter_actor_animate (actor, CLUTTER_EASE_SINE_OUT, 500, "x", event->x, "y", event->y, NULL);