Migrating from ClutterEffect

EmmanueleBassi

Since version 1.0, Clutter provides the ClutterAnimation API
and the clutter_actor_animate() family of functions as replacements
for the ClutterEffectTemplate and
clutter_effect_* API for creating simple, one-off animations.

Prior to Clutter 1.0, the way to create simple, one-off
animations involving a single actor was the ClutterEffect API. The
major downside of this API was that to abstract the duration and
easing function of the animation the application developer had to
create a ClutterEffectTemplate and keep it
around for the duration of the application.

The clutter_actor_animate() function performs all of the
memory management that was delegated to the
ClutterEffectTemplate, freeing the developer
from having to deal with object bookkeeping.

Another downside of the ClutterEffect API is that every
possible animation has its own function (scaling, opacity, rotation,
movement, etc.), and new functions cannot be added outside of
Clutter.

Example 1. Effect example

The following code shows a simple animation using
the ClutterEffect API. It animates an actor linearly in 500
milliseconds, by moving it to the (100, 100) coordinates
while fading it out.