| Home | Trees | Indices | Help |
|---|
|
|
object --+
|
timeline.Timeline --+
|
ThingObjects.Thing --+
|
LoopThing
A LoopThing is a way to control the frames of a Loop that you get from your BagOfStuff. Normally you simply draw() an item in the bag and you can't set the keys at which its sub-frames appear.
Use a LoopThing to set keys (etc.) on a loop. Each frame of your loop will appear once per keyframe, marching forward in time.
Now you can tween a walk-cycle (say) from one keyframe to the next.
Typical use:
class TweenLoopWalk(LoopThing):
def __init__(self):
LoopThing.__init__(self,"DuckWalking")
## Let's assume our walkloop has three frames. Here we choose to tween it between
## four keyframes, so that we get a smooth cycle.
self.keys ( "#---#---#---#", Props(),Props(x=10),Props(x=10,y=10),Props(x=20,y=-20))
## Now get a loop cycle from an SVG file:
BOOP = BOS['rsvg:walkloop'] # Where BOS is an instance of a BagOfStuff.
## And add it to myself with the special method for this:
self.addLoop(BOOP)
ends.
You don't have to have a draw() method, but if you do then be sure to call the draw() method of the LoopThing after you are done:
Example:
def draw(self,ctx,fr): someShape(ctx) # your own extra drawing # To continue the draw, call the parent's draw method. LoopThing.draw(self,ctx,fr)
ends.
| Instance Methods | |||
|
|||
|
|||
|
|||
|
Inherited from Inherited from Inherited from |
|||
| Instance Variables | |
|
Inherited from Inherited from |
| Properties | |
|
Inherited from |
| Method Details |
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
|
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Tue May 26 16:03:26 2009 | http://epydoc.sourceforge.net |