mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
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:
parent
e332236b87
commit
1b2606a850
@ -97,27 +97,27 @@ main (int argc, char *argv[])
|
||||
clutter_container_add_actor (CLUTTER_CONTAINER (box), front);
|
||||
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_image (CLUTTER_TEXTURE (back), source);
|
||||
|
||||
/* load the second image into the front */
|
||||
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 */
|
||||
clutter_state_set_state (transitions, "show-front");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user