docs: Use ClutterTimeline:repeat-count instead of :loop

This commit is contained in:
Emmanuele Bassi 2012-02-13 15:26:26 +00:00
parent cf9c4e651d
commit d808367fe4
2 changed files with 12 additions and 5 deletions

View File

@ -185,9 +185,16 @@ on_new_frame (ClutterTimeline *timeline,
ClutterTimeline *timeline; ClutterTimeline *timeline;
timeline = clutter_timeline_new (1000); /* one second */ /* one second */
clutter_timeline_set_loop (timeline, TRUE); timeline = clutter_timeline_new (1000);
/* looping indefinitely */
clutter_timeline_set_repeat_count (timeline, -1);
/* get a notification each time a new frame should be drawn */
g_signal_connect (timeline, "new-frame", G_CALLBACK (on_new_frame), actor); g_signal_connect (timeline, "new-frame", G_CALLBACK (on_new_frame), actor);
/* start the timeline once control returns to the main loop */
clutter_timeline_start (timeline); clutter_timeline_start (timeline);
</programlisting> </programlisting>
</example> </example>
@ -307,9 +314,9 @@ main (int argc, char *argv[])
actor = clutter_texture_new_from_file ("ohpowers.png", NULL); actor = clutter_texture_new_from_file ("ohpowers.png", NULL);
clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor); clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor);
/* set up the animation to be 4 seconds long */ /* set up the animation to be 4 seconds long, and looping indefinitely */
timeline = clutter_timeline_new (4000); timeline = clutter_timeline_new (4000);
clutter_timeline_set_loop (timeline, TRUE); clutter_timeline_set_repeat_count (timeline, -1);
/* set up a sinusoidal easing mode to power the behaviour; the /* set up a sinusoidal easing mode to power the behaviour; the
* alpha will take a reference on the timeline so we can safely * alpha will take a reference on the timeline so we can safely

View File

@ -105,7 +105,7 @@ reverse_timeline (ClutterTimeline *timeline)
NULL); NULL);
ClutterTimeline *timeline = clutter_animation_get_timeline (animation); ClutterTimeline *timeline = clutter_animation_get_timeline (animation);
clutter_timeline_set_loop (timeline, TRUE); clutter_timeline_set_repeat_count (timeline, -1);
clutter_timeline_set_auto_reverse (timeline, TRUE); clutter_timeline_set_auto_reverse (timeline, TRUE);
</programlisting> </programlisting>
</informalexample> </informalexample>