
@c %start of fragment

@node Implicit Animations
@chapter Implicit Animations
Simple implicit animations

@section Overview
@code{<clutter-animation>} is an object providing simple, implicit
animations for @code{<gobject>}s.

@code{<clutter-animation>} instances will bind one or more
@code{<gobject>} properties belonging to a @code{<gobject>} to a
@code{<clutter-interval>}, and will then use a @code{<clutter-alpha>} to
interpolate the property between the initial and final values of the
interval.

The duration of the animation is set using
@code{clutter-animation-set-duration}. The easing mode of the animation
is set using @code{clutter-animation-set-mode}.

If you want to control the animation you should retrieve the
@code{<clutter-timeline>} using @code{clutter-animation-get-timeline}
and then use @code{<clutter-timeline>} functions like
@code{clutter-timeline-start}, @code{clutter-timeline-pause} or
@code{clutter-timeline-stop}.

A @code{<clutter-animation>} will emit the @code{<"completed">} signal
when the @code{<clutter-timeline>} used by the animation is completed;
unlike @code{<clutter-timeline>}, though, the @code{<"completed">} will
not be emitted if @code{<"loop">} is set to @samp{@code{#t}} - that is,
a looping animation never completes.

If your animation depends on user control you can force its completion
using @code{clutter-animation-completed}.

If the @code{<gobject>} instance bound to a @code{<clutter-animation>}
implements the @code{<clutter-animatable>} interface it is possible for
that instance to control the way the initial and final states are
interpolated.

@code{<clutter-animation>}s are distinguished from
@code{<clutter-behaviour>}s because the former can only control
@code{<gobject>} properties of a single @code{<gobject>} instance, while
the latter can control multiple properties using accessor functions
inside the @code{<clutter-behaviour>}@code{alpha-notify} virtual
function, and can control multiple @code{<clutter-actor>}s as well.

For convenience, it is possible to use the @code{clutter-actor-animate}
function call which will take care of setting up and tearing down a
@code{<clutter-animation>} instance and animate an actor between its
current state and the specified final state.

@section Defining ClutterAnimationMode inside ClutterScript
When defining a @code{<clutter-animation>} inside a ClutterScript file
or string the @code{<"mode">} can be defined either using the
@code{<clutter-animation-mode>} enumeration values through their "nick"
(the short string used inside @code{<g-enum-value>}), their numeric id,
or using the following strings:

@table @var
@item easeInCubic, easeOutCubic, easeInOutCubic

@c %start of fragment


@c %end of fragment
@item easeInQuart, easeOutQuart, easeInOutQuart

@c %start of fragment


@c %end of fragment
@item easeInQuint, easeOutQuint, easeInOutQuint

@c %start of fragment


@c %end of fragment
@item easeInSine, easeOutSine, easeInOutSine

@c %start of fragment


@c %end of fragment
@item easeInExpo, easeOutExpo, easeInOutExpo

@c %start of fragment


@c %end of fragment
@item easeInCirc, easeOutCirc, easeInOutCirc

@c %start of fragment


@c %end of fragment
@item easeInElastic, easeOutElastic, easeInOutElastic

@c %start of fragment


@c %end of fragment
@item easeInBack, easeOutBack, easeInOutBack

@c %start of fragment


@c %end of fragment
@item easeInBounce, easeOutBounce, easeInOutBounce

@c %start of fragment


@c %end of fragment
@end table

Corresponding to the quadratic easing modes

Corresponding to the cubic easing modes

Corresponding to the quartic easing modes

Corresponding to the quintic easing modes

Corresponding to the sine easing modes

Corresponding to the exponential easing modes

Corresponding to the circular easing modes

Corresponding to the overshooting elastic easing modes

Corresponding to the overshooting cubic easing modes

Corresponding to the bouncing easing modes

@c (example (@ (id "example-clutter-animation")))
@c (title "Tweening using " (code "clutter-actor-animate"))
@example 
@c (http://www.w3.org/2001/XInclude:include (@ (parse "text") (href "../../../../tests/interactive/test-easing.c")) (c (% (all "(http://www.w3.org/2001/XInclude:fallback \"FIXME: MISSING XINCLUDE CONTENT\")"))))
@end example

@code{<clutter-animation>} is available since Clutter 1.0

@section Usage
@include defuns-clutter-animation.xml.texi

@c %end of fragment
