On Sat, 2009-04-18 at 12:20 +1000, Saul Lethbridge wrote:
> I'm trying to execute a second animation on completion of the first. I
> can't get this to work though (compiles but the second animation is
> not executed). I've altered the example animation to demonstrate what
> I'm trying to do.
the documentation for clutter_actor_animate() says:
"""
Since the created #ClutterAnimation instance attached to @actor
is guaranteed to be valid throughout the #ClutterAnimation::completed
signal emission chain, you will not be able to create a new animation
using clutter_actor_animate() on the same @actor from within the
#ClutterAnimation::completed signal handler. Instead, you should use
clutter_threads_add_idle() to install an idle handler and call
clutter_actor_animate() in the handler [...].
"""
this is because we want clutter_actor_animate() and friends to coalesce
multiple animation calls.
the documentation also comes with an example:
static gboolean
queue_animation (gpointer data)
{
ClutterActor *actor = data;
clutter_actor_animate (actor, CLUTTER_EASE_IN_CUBIC, 250,
"width", 200,
"height", 200,
NULL);
return FALSE;
}
static void
on_animation_completed (ClutterAnimation *animation)
{
clutter_threads_add_idle (queue_animation,
clutter_animation_get_object (animation));
}
/* ... */
animation = clutter_actor_animate (actor, CLUTTER_EASE_IN_CUBIC, 250,
"x", 100,
"y", 100,
NULL);
g_signal_connect (animation, "completed",
G_CALLBACK (on_animation_completed),
NULL);
ciao,
Emmanuele.
--
Emmanuele Bassi, Senior Engineer | [email protected]
Intel Open Source Technology Center | http://oss.intel.com
--
To unsubscribe send a mail to [email protected]