is an object that holds an animation. An animation is conceptually a series
of frames to be displayed over time. Each frame is the same size. The
animation may not be represented as a series of frames internally; for
example, it may be stored as a sprite and instructions for moving the sprite
around a background. To display an animation you don't need to understand
its representation, you just ask a
for the next frame that should be displayed at a given point in time.
|the name of the file to load.|
|a new |
Creates a new
by loading it from a file. The file format is detected automatically. If the
file's format does not support multi-frame images, then an animation with a
single frame will be created.
This constructor raises the GError exception if any of several error conditions occurred: the file could not be opened, there was no loader for the file's format, there was not enough memory to allocate the image buffer, or the image file contained invalid data.
|the width of the bounding box of the animation.|
get_width() method returns the
width of the bounding box of a pixbuf animation.
|the height of the bounding box of the animation.|
get_height() method returns the
height of the bounding box of a pixbuf animation.
is_static_image() method returns
True if you load a file containing a plain, unanimated image. Use the
method to retrieve the image.
|the unanimated image representing the animation|
get_static_image() method returns a
that represents a static image of the animation. If the animation is really
just a plain image (has only one frame), this method returns that image. If
the animation is an animation, this method returns a reasonable thing to
display as a static unanimated image, which might be the first frame, or
something more sophisticated. If an animation hasn't loaded any frames yet,
this method will return
|the time when the animation starts playing|
get_iter() method returns a
that is used to access the frames of the animation. The iterator provides
the frames that should be displayed at specific times.
start_time is the start time specified as a float as
output from the Python time.time() function.
start_time marks the beginning of the animation
playback. After creating an iterator, you should immediately display the
pixbuf returned by the
method. Then, you should install a timeout (with the
method. Each time the image is updated, you should reinstall the timeout
with the new, possibly-changed delay time. As a shortcut, if
start_time is 0.0 (the default), the current time
will be used.
If you're using a
in addition to updating the image after the delay time, you should also
update it whenever you receive the "area_updated" signal and the
True. In this case, the frame currently
being fed into the loader has received new data, so needs to be refreshed.
The delay time for a frame may also be modified after an "area_updated"
signal, for example if the delay time for a frame is encoded in the data
after the frame itself. So your timeout should be reinstalled after any
area_updated signal. A delay time of -1 is possible, indicating
© manpagez.com 2000-2019 Individual documents may contain additional copyright information.