clutter.Timeline — A class for time based animations
class clutter.Timeline: |
|
def callback( | |
def callback( | |
"started" | def callback( |
"paused" | def callback( |
clutter.Timeline
is a base class for managing time based events such as animations.
Every timeline shares the same timeout pool to decrease the
possibility of starvating the main loop when using many timelines
at the same time; this might cause problems if you are also using
a library making heavy use of threads with no GLib main loop
integration. In that case you might disable the common timeline
pool by setting the CLUTTER_TIMELINE=no-pool
environment variable prior to launching your application.
clutter.Timeline(fps, num_frames, duration)
| frames per second (optional) |
| number of frames (optional) |
| duration in milliseconds (optional) |
Returns : | a new clutter.Timeline.
|
Creates a new clutter.Timeline object.
def get_duration()
Returns : | the duration of the timeline in milliseconds. |
The get_duration() method retrieves the
duration of the timeline in milliseconds, at the current frame
rate.
def set_duration(duration)
duration
The set_duration() method sets the
duration of the timeline in milliseconds, at the current frame
rate.
def get_direction()
Returns : | the direction of the timeline. |
The get_direction() method retrieves the
direction of the timeline, either forward or backward.
rate.
def set_direction(direction)
direction clutter.TIMELINE_FORWARD or
clutter.TIMELINE_BACKWARD
The set_direction() method sets the
direction of the timeline.
def get_loop()
Returns : | whether the timeline is looping or not. |
The get_loop() method will return
whether the timeline is looping or not. A looping timeline
will restart from the beginning every time it reaches its
duration.
def set_loop(loop)
loop
The set_loop() method sets whether
the timeline should loop or not.
def get_progress()
Returns : | the progress of the timeline. |
The get_progress() method retrieves the
progress of the timeline as a floating point number in the [0, 1]
interval.
def callback(timeline, frame_num, user_param1, ...)
| the timeline that received the signal |
| the new frame |
| the first user parameter (if any) specified with the connect() |
| additional user parameters (if any) |
The "new-frame" signal is emitted each time a new frame in the
timeline is reached. The frame number is provided because
clutter.Timeline might drop frames to maintain
the overall duration.
def callback(timeline, user_param1, ...)
| the timeline that received the signal |
| the first user parameter (if any) specified with the connect() |
| additional user parameters (if any) |
The "started" signal is emitted each time a timeline is started.
def callback(timeline, user_param1, ...)
| the timeline that received the signal |
| the first user parameter (if any) specified with the connect() |
| additional user parameters (if any) |
The "paused" signal is emitted each time a timeline is paused.
def callback(timeline, user_param1, ...)
| the timeline that received the signal |
| the first user parameter (if any) specified with the connect() |
| additional user parameters (if any) |
The "completed" signal is emitted each time a timeline reaches its last frame. The signal will be emitted multiple times if the timeline is looping.