Package Things :: Module ThingObjects :: Class ClipThing
[frames] | no frames]

Class ClipThing

       object --+        
                |        
timeline.Timeline --+    
                    |    
                Thing --+
                        |
                       ClipThing

Use this to have this Thing become a clip for all its children. If you want to animate this entire ClipThing, then wrap it in another Thing.

This ClipThing can animate via its draw method, this will affect the clip(mask) itself -- create animated masks in this way. You would do this by making sure a slightly different path was drawn each frame. You could use a BagOfStuff path and draw a new path based on the 'frame_number' argument that gets passed to draw().

Use

Typical use:

 class ChopChop(ClipThing):
   def __init__(self,x, y): # the params are up to you
     ## Init the class
     ClipThing.__init__( self, id="button" )
     self.add( SomeOtherThing ) #Will be clipped by what I draw() below.
   def draw(self,ctx,fr):
     ## Let's make a circle mask:
     drawACircle() #Do not stroke/fill it.

.

Instance Methods
 
__init__(self, id='Clipper')
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Inherited from Thing: __len__, changeLayer, changeProps, funcs, getProps, goPlay, goStop, jumps, keys, labels, loop, nextFrame, play, showData, stop, stops, toTop

Inherited from timeline.Timeline: add

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

Instance Variables

Inherited from Thing: currentFrame, frame, globalProps, lifespan

Inherited from timeline.Timeline: parentThing

Properties

Inherited from object: __class__

Method Details

__init__(self, id='Clipper')
(Constructor)

 

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

Parameters:
  • id - A string to identify this Thing. It's mainly for debug purposes, but handy within your own code too.
Overrides: object.__init__
(inherited documentation)