Package Things :: Module BagOfStuff :: Class Loop
[frames] | no frames]

Class Loop

object --+    
         |    
   _Vector --+
             |
            Loop

A series of GROUPS from an SVG file that will be displayed as frames.

First add the SVG file to your Bag Of Stuff. see help(BagOfStuff.add) Don't instantiate a Loop directly, work via BagOfStuff.

Use

bos["walking:funny"].Props(bounce=False)

bos["walking:funny"].draw(ctx)

See Props() method.

Instance Methods
 
__init__(self, id, loops, bag, nskey)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
Props(self, currentFrame=0, bounce=True, autoinc=True, stretch=1)
Sets Properties of the Loop.
 
draw(self, ctx)
draw() takes only a context.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, id, loops, bag, nskey)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

Props(self, currentFrame=0, bounce=True, autoinc=True, stretch=1)

 

Sets Properties of the Loop. Call this after you have added an SVG (with loops) to a BagOfStuff.

Use example

bos['walking:run_cycle'].Props( bounce=False )

Parameters:
  • currentFrame - Set the frame number (integer) to show/start from.
  • bounce - True is 1,2,3,2,1 and False is 1,2,3,1,2,3
  • autoinc - False means it simply stays on frame currentFrame.
  • stretch - An Integer. The frame will repeat this many times before going on to the next one. Use it to stretch-out an animation that is too fast. Be sure to leave enough room in the keys (use "=" same-frame keys) of the parent for the animation to fit. If it's 3 frames and stretch=2, leave 6 frames.

    Seriously: See the LoopThing in the Thinglets module. It's a better way to do this.