if a.StillGoing():
new_frame_to_draw = a.NewFrame()
if new_frame_to_draw:
draw(new_frame_to_draw)
else:
# old frame to be rendered.
pass
else:
# figure out what to do at end of anim.
pass
|
Methods
|
|
|
|
|
|
A__nonzero__
|
A__nonzero__ ( self )
Used to see if the animation is still going.
|
|
|
GetLengthOfAnim
|
GetLengthOfAnim ( self )
|
|
|
GetName
|
GetName ( self )
|
|
|
GetNumTimesPlayed
|
GetNumTimesPlayed ( self )
Returns the number of times the animation has been played.
|
|
|
NewFrame
|
NewFrame ( self )
Returns the frame name if there is a new frame needed for the animation.
Otherwise returns 0.
|
|
|
SetUpAnimationData
|
SetUpAnimationData ( self, animation_data )
Sets up the animation data ready for processing.
|
|
|
Start
|
Start ( self, loop=1 )
Starts the animation at the beginning.
|
|
|
StillGoing
|
StillGoing ( self )
returns the frame name if still going else, returns 0 if finished.
|
|
|
_GetFrameGivenTimeInAnim
|
_GetFrameGivenTimeInAnim ( self, time_in_anim )
Returns the frame name we should be rendering given a time in the anim.
|
|
|
__init__
|
__init__ (
self,
animation_data,
name,
loop=1,
)
animation_data - a list of tuples (frame_name, time).
The time part says for how long in the animation that the
frame should be shown.
Must have at least one element. loop - should the animation loop.
If 0 the animation will return the last frame when it gets to the end.
If -1 the animation will loop for ever.
If non zero the animation will loop that many times.
|