clutter.Timeline

clutter.Timeline — A class for time based animations

Synopsis

class clutter.Timeline:
    clutter.Timeline(fps, num_frames, duration)
def get_duration()
def set_duration(msecs)
def get_direction()
def set_direction(direction)
def get_loop()
def set_loop(loop)
def get_progress()
def start()
def pause()
def stop()
def rewind()

Ancestry

gobject.GObject
 +--clutter.Timeline
  

Properties

"duration"Read-WriteThe duration of the timeline, in milliseconds.
"fpd"Read-WriteFrames per second.
"num-frames"Read-WriteThe total number of frames.
"loop"Read-WriteWether the timeline should loop.
"delay"Read-WriteA delay, in milliseconds, that should be observed by the timeline before actually starting.
"direction"Read-WriteThe direction of the timeline, either clutter.TIMELINE_FORWARD or clutter.TIMELINE_BACKWARD.

Signal Prototypes

"new-frame"

def callback(timeline, frame_num, user_param1, ...)

"completed"

def callback(timeline, user_param1, ...)

"started"

def callback(timeline, user_param1, ...)

"paused"

def callback(timeline, user_param1, ...)

Description

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.

Constructor

    clutter.Timeline(fps, num_frames, duration)

fps 

frames per second (optional)

num_frames 

number of frames (optional)

duration 

duration in milliseconds (optional)

Returns :

a new clutter.Timeline.

Creates a new clutter.Timeline object.

Methods

clutter.Timeline.get_duration

          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.

clutter.Timeline.set_duration

          def set_duration(duration)
    
duration 
duration in milliseconds

The set_duration() method sets the duration of the timeline in milliseconds, at the current frame rate.

clutter.Timeline.get_direction

          def get_direction()
    

Returns :

the direction of the timeline.

The get_direction() method retrieves the direction of the timeline, either forward or backward. rate.

clutter.Timeline.set_direction

          def set_direction(direction)
    
direction 
either clutter.TIMELINE_FORWARD or clutter.TIMELINE_BACKWARD

The set_direction() method sets the direction of the timeline.

clutter.Timeline.get_loop

          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.

clutter.Timeline.set_loop

          def set_loop(loop)
    
loop 
True if the timeline should loop, False otherwise

The set_loop() method sets whether the timeline should loop or not.

clutter.Timeline.get_progress

          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.

clutter.Timeline.start

          def start()
    

The start() method starts the timeline.

clutter.Timeline.pause

          def pause()
    

The pause() method pauses the timeline.

clutter.Timeline.stop

          def stop()
    

The stop() method pauses the timeline and rewinds it to the beginning.

clutter.Timeline.rewind

          def rewind()
    

The rewind() method moves the timeline to its beginning frame without stopping it.

Signals

The "new-frame" clutter.Timeline Signal

          def callback(timeline, frame_num, user_param1, ...)
    

timeline :

the timeline that received the signal

frame_num :

the new frame

user_param1 :

the first user parameter (if any) specified with the connect() method

... :

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.

The "started" clutter.Timeline Signal

          def callback(timeline, user_param1, ...)
    

timeline :

the timeline that received the signal

user_param1 :

the first user parameter (if any) specified with the connect() method

... :

additional user parameters (if any)

The "started" signal is emitted each time a timeline is started.

The "paused" clutter.Timeline Signal

          def callback(timeline, user_param1, ...)
    

timeline :

the timeline that received the signal

user_param1 :

the first user parameter (if any) specified with the connect() method

... :

additional user parameters (if any)

The "paused" signal is emitted each time a timeline is paused.

The "completed" clutter.Timeline Signal

          def callback(timeline, user_param1, ...)
    

timeline :

the timeline that received the signal

user_param1 :

the first user parameter (if any) specified with the connect() method

... :

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.