cookbook: Modified ordering of statements in cross-fade example

Changed the order of statements in the sample code to match
the order they will be explained in the walk-through in the recipe.
This commit is contained in:
Elliot Smith 2010-08-17 10:56:06 +01:00
parent e332236b87
commit 1b2606a850

View File

@ -97,27 +97,27 @@ main (int argc, char *argv[])
clutter_container_add_actor (CLUTTER_CONTAINER (box), front); clutter_container_add_actor (CLUTTER_CONTAINER (box), front);
clutter_container_add_actor (CLUTTER_CONTAINER (stage), box); clutter_container_add_actor (CLUTTER_CONTAINER (stage), box);
/* animations */
transitions = clutter_state_new ();
clutter_state_set (transitions, NULL, "show-front",
front, "opacity", CLUTTER_EASE_IN_CUBIC, 255,
back, "opacity", CLUTTER_EASE_IN_CUBIC, 0,
NULL);
clutter_state_set (transitions, NULL, "show-back",
front, "opacity", CLUTTER_LINEAR, 0,
back, "opacity", CLUTTER_LINEAR, 255,
NULL);
clutter_state_set_duration (transitions, NULL, NULL, duration);
/* make the back opaque and front transparent */
clutter_state_warp_to_state (transitions, "show-back");
/* load the first image into the back */ /* load the first image into the back */
load_image (CLUTTER_TEXTURE (back), source); load_image (CLUTTER_TEXTURE (back), source);
/* load the second image into the front */ /* load the second image into the front */
load_image (CLUTTER_TEXTURE (front), target); load_image (CLUTTER_TEXTURE (front), target);
/* animations */
transitions = clutter_state_new ();
clutter_state_set (transitions, NULL, "show-back",
front, "opacity", CLUTTER_LINEAR, 0,
back, "opacity", CLUTTER_LINEAR, 255,
NULL);
clutter_state_set (transitions, NULL, "show-front",
front, "opacity", CLUTTER_EASE_IN_CUBIC, 255,
back, "opacity", CLUTTER_EASE_IN_CUBIC, 0,
NULL);
clutter_state_set_duration (transitions, NULL, NULL, duration);
/* make the back opaque and front transparent */
clutter_state_warp_to_state (transitions, "show-back");
/* fade in the front texture and fade out the back texture */ /* fade in the front texture and fade out the back texture */
clutter_state_set_state (transitions, "show-front"); clutter_state_set_state (transitions, "show-front");