Table of Contents
A ClutterTimeline can be used to change the position or appearance of an actor over time.
These can be used directly as described in this chapter, or together with an animation or behaviour, as you will see in
the following chapters.
The timeline object emits its new-frame signal for each frame that should be drawn,
for as many frames per second as appropriate. In your signal handler you can set the actor's properties.
For instance, the actor might be moved and rotated over time, and its color might change while this is happening.
You could even change the properties of several actors to animate the entire stage.
The clutter_timeline_new() constructor function takes a duration in milliseconds. The actual number of frames per second requested by the timeline will depend on the behaviour of your entire program, the performance of your hardware, and your monitor's refresh rate. It may even vary over time as conditions change. At best, the new-frame signal will be emitted at your monitor's refresh rate. At worst it will be called once at the start and once at the end of your timeline's duration.
Clutter will not attempt to redraw the scene if the new frame has no change compared to the previous frame, so you don't need to do your own optimization to prevent unnecessary redraws.
You may also use clutter_timeline_set_loop() to cause the timeline to
repeat for ever, or until you call clutter_timeline_stop(). The timeline does not start
until you call clutter_timeline_start().
Remember to unref the timeline when you are finished with it. Unlike actors, this does not have a "floating reference".
You may either do this after your mainloop has finished, or when the timeline has finished, by handling the
timeline's completed signal.