set_auto_reverse
Description:
Sets whether this should reverse the direction after the emission of the completed signal.
Setting the auto_reverse property to true
is the
equivalent of connecting a callback to the completed signal and
changing the direction of the timeline from that callback; for instance, this code:
static void
reverse_timeline (ClutterTimeline *timeline)
{
ClutterTimelineDirection dir = clutter_timeline_get_direction (timeline);
if (dir == CLUTTER_TIMELINE_FORWARD)
dir = CLUTTER_TIMELINE_BACKWARD;
else
dir = CLUTTER_TIMELINE_FORWARD;
clutter_timeline_set_direction (timeline, dir);
}
...
timeline = clutter_timeline_new (1000);
clutter_timeline_set_repeat_count (timeline, -1);
g_signal_connect (timeline, "completed",
G_CALLBACK (reverse_timeline),
NULL);
can be effectively replaced by:
timeline = clutter_timeline_new (1000);
clutter_timeline_set_repeat_count (timeline, -1);
clutter_timeline_set_auto_reverse (timeline);
Parameters:
this |
a Timeline |
reverse |
|