mirror of
https://github.com/brl/mutter.git
synced 2024-12-24 12:02:04 +00:00
[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.
This commit is contained in:
parent
b09ee495a5
commit
0530405899
@ -290,67 +290,14 @@ main (int argc, char *argv[])
|
|||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
|
|
||||||
A ClutterAlpha is simply a 'function of time' (not a pixel alpha!). It
|
A ClutterAlpha is simply a 'function of time' (not a pixel alpha channel!).
|
||||||
is created by referencing a source timeline and a function which
|
It is created by referencing a source timeline and an "easing mode" which
|
||||||
produces a value between 0 and %CLUTTER_ALPHA_MAX dependant on the
|
produces a value between -1 and 2 depending on the progress of the
|
||||||
timeline position. Various prebuilt alpha functions are included
|
timeline. Clutter provides various easing modes, as described by
|
||||||
with Clutter these include
|
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.
|
||||||
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
|
|
||||||
<variablelist>
|
|
||||||
<varlistentry>
|
|
||||||
<term>%CLUTTER_ALPHA_RAMP_INC</term>
|
|
||||||
<listitem><simpara>Increasing ramp function</simpara></listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term>%CLUTTER_ALPHA_RAMP_DEC</term>
|
|
||||||
<listitem><simpara>Decreasing ramp function</simpara></listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term>%CLUTTER_ALPHA_RAMP</term>
|
|
||||||
<listitem><simpara>Full ramp function</simpara></listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term>%CLUTTER_ALPHA_SINE_INC</term>
|
|
||||||
<listitem><simpara>Increasing sine function</simpara></listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term>%CLUTTER_ALPHA_SINE_DEC</term>
|
|
||||||
<listitem><simpara>Decreasing sine function</simpara></listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term>%CLUTTER_ALPHA_SINE_HALF</term>
|
|
||||||
<listitem><simpara>Half sine function</simpara></listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term>%CLUTTER_ALPHA_SINE</term>
|
|
||||||
<listitem><simpara>Full sine function</simpara></listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term>%CLUTTER_ALPHA_SQUARE</term>
|
|
||||||
<listitem><simpara>Square waveform ("step") function</simpara></listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term>%CLUTTER_ALPHA_SMOOTHSTEP_INC</term>
|
|
||||||
<listitem><simpara>Increasing smooth transition step
|
|
||||||
function</simpara></listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term>%CLUTTER_ALPHA_SMOOTHSTEP_DEC</term>
|
|
||||||
<listitem><simpara>Decreasing smooth transition step
|
|
||||||
function</simpara></listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term>%CLUTTER_ALPHA_EXP_INC</term>
|
|
||||||
<listitem><simpara>Increasing exponential function</simpara></listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term>%CLUTTER_ALPHA_EXP_DEC</term>
|
|
||||||
<listitem><simpara>Decreasing exponential function</simpara></listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</variablelist>
|
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
|
|
||||||
@ -369,10 +316,7 @@ main (int argc, char *argv[])
|
|||||||
feature of the actor dependant on the Alpha's value. For example a
|
feature of the actor dependant on the Alpha's value. For example a
|
||||||
path based behaviour applied to an actor will alter its position
|
path based behaviour applied to an actor will alter its position
|
||||||
along the path dependant on the current alpha value over time. The
|
along the path dependant on the current alpha value over time. The
|
||||||
actual motion will depend on the chosen #ClutterAlphaFunc - a
|
actual motion will depend on the chosen "easing mode".
|
||||||
#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.
|
|
||||||
|
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
@ -393,9 +337,9 @@ main (int argc, char *argv[])
|
|||||||
<blockquote>
|
<blockquote>
|
||||||
The actors position between the path's end points directly correlates
|
The actors position between the path's end points directly correlates
|
||||||
to the #ClutterAlpha's current alpha value driving the behaviour. With
|
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
|
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.
|
decelerating.
|
||||||
</blockquote>
|
</blockquote>
|
||||||
</figure>
|
</figure>
|
||||||
@ -468,9 +412,7 @@ main (int argc, char *argv[])
|
|||||||
clutter_timeline_set_loop (timeline, TRUE);
|
clutter_timeline_set_loop (timeline, TRUE);
|
||||||
|
|
||||||
/* Set an alpha func to power the behaviour */
|
/* Set an alpha func to power the behaviour */
|
||||||
alpha = clutter_alpha_new_full (timeline,
|
alpha = clutter_alpha_new_full (timeline, CLUTTER_EASE_SINE_IN_OUT);
|
||||||
CLUTTER_ALPHA_SINE,
|
|
||||||
NULL, NULL);
|
|
||||||
|
|
||||||
behave = clutter_behaviour_ellipse_new (alpha,
|
behave = clutter_behaviour_ellipse_new (alpha,
|
||||||
200, /* center x */
|
200, /* center x */
|
||||||
@ -576,7 +518,7 @@ main (int argc, char *argv[])
|
|||||||
ClutterButtonEvent *event,
|
ClutterButtonEvent *event,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
clutter_actor_animate (actor, CLUTTER_SINE_IN_OUT, 500,
|
clutter_actor_animate (actor, CLUTTER_EASE_SINE_OUT, 500,
|
||||||
"x", event->x,
|
"x", event->x,
|
||||||
"y", event->y,
|
"y", event->y,
|
||||||
NULL);
|
NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user