Table of Contents
A Clutter::Timeline
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 effect
or behaviour, as you will see in the following chapters.
The timeline object emits its signal_new_frame()
signal for each frame
that should be drawn, for as many frames per second as specified. 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::create()
constructor function takes a number of
frames, and a number of frames per second, so the entire timeline will have a duration of
n_frames
/ fps
. You might therefore choose the number
of frames based on a desired duration, by dividing the duration by the desired frames per
second.
You may also use Clutter::Timeline::set_loop()
to cause the timeline to
repeat forever, or until you call Clutter::Timeline::stop()
. The timeline does
not start until you call Clutter::Timeline::start()
.
When a timeline has completed, it emits the signal_completed()
signal.