Home | Trees | Index | Help |
---|
|
A sequence of animation frames that constitute an animation. Each animation frame consists of an image that should be displayed during that frame, and a duration specifying how long the frame should be displayed (measured in an abstract unit called 'ticks'). Every image in an animation sequence must have the same size.
Every animation has an anchor, which is the position that should be considered the 'center' fo the animation. When a sprite changes from one animation to another, the anchor of the new animation will be placed at the same location as the anchor of the old animation.Method Summary | |
---|---|
Create a new animation sequence. | |
duration(self)
| |
Load the images that were specified by the imagespecs passed to the constructor. |
Instance Variable Summary | |
---|---|
anchor_offset : The distance from the animation's anchor to the position
(width/2, height/2) . | |
default_speed : The default animation speed for this animation sequence. | |
durations : A list containing the duration of each animation frame, in ticks. | |
images : A list containing the image for each animation frame. | |
imagespecs : Image specifications for the images used by this frame. | |
loop : A flag indicating whether the animation should loop back to the
beginning after it reaches the last frame. | |
name : The name of this animation sequence. | |
next : The animation sequence to go to after this one finishes (only used if
loop=False). | |
size : The size of the images used by this animation frame. |
Method Details |
---|
__init__(self,
name,
imagespecs,
durations=None,
loop=True,
next=None,
default_speed=1,
anchor_offset=(0, 0),
fliphoriz=False,
flipvert=False,
reverse=False,
rotate=0)
Create a new animation sequence.
|
duration(self) |
load_images(self)Load the images that were specified by the imagespecs passed to the constructor. This should be called after the pygame display has been initialized. |
Instance Variable Details |
---|
anchor_offsetThe distance from the animation's anchor to the position(width/2, height/2) .
|
default_speedThe default animation speed for this animation sequence. |
durationsA list containing the duration of each animation frame, in ticks. |
imagesA list containing the image for each animation frame. This variable is initialized byload_images .
|
imagespecsImage specifications for the images used by this frame. |
loopA flag indicating whether the animation should loop back to the beginning after it reaches the last frame. |
nameThe name of this animation sequence. |
nextThe animation sequence to go to after this one finishes (only used if loop=False). |
sizeThe size of the images used by this animation frame. This variable is initialized byload_images .
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Thu Sep 22 22:52:49 2005 | http://epydoc.sf.net |