Hello,
I've just started experimenting a little bit with Clutter (1.2.4 on Ubuntu
10.04). I have a problem
setting the opacity of an actor back to "full opaque" after an animation
that faded it to full transparency by connecting
to the "completed" signal of the animation. Unfortunately, it seems that the
opacity is not taken into account, and the
actor remains fully transparent.

Am I missing something?

This is a simple example that shows what I'm trying to do:

#include <clutter/clutter.h>
#include <stdlib.h>

static void
on_animation_completed (ClutterAnimation *animation,
                          ClutterActor     *actor)
{
    clutter_actor_set_opacity (actor, 255);  /* Reset opacity back to full
opaque */
}


int main(int argc, char *argv[]) {
        clutter_init(&argc, &argv);

        ClutterColor stage_color = { 0, 0, 0, 255 };

        ClutterActor *stage = clutter_stage_get_default();
        clutter_actor_set_size(stage, 512, 512);
        clutter_stage_set_color(CLUTTER_STAGE(stage), &stage_color);
        clutter_actor_show(stage);

        ClutterColor actor_color = { 0, 255, 0, 128 };
        ClutterActor *rect = clutter_rectangle_new_with_color(&actor_color);
        clutter_actor_set_size(rect, 100, 100);
        clutter_actor_set_position(rect, 100, 100);
        clutter_container_add_actor(CLUTTER_CONTAINER(stage), rect);
        clutter_actor_show(rect);

        clutter_actor_animate (rect, CLUTTER_EASE_IN_CUBIC, 5000,
                         "opacity", 0,
                         "signal::completed", on_animation_completed, rect,
                         NULL);

        clutter_main();

        return EXIT_SUCCESS;
}

Any help or hints would be gratefully appreciated!

cheers

Amos
_______________________________________________
clutter-app-devel-list mailing list
[email protected]
http://lists.clutter-project.org/listinfo/clutter-app-devel-list

Reply via email to