| Home | Trees | Indices | Help |
|---|
|
|
object --+
|
timeline.Timeline --+
|
Thing --+
|
HitThing
Subclass this to have your object draw a hit area and detect hits. This gives your Thing the power to receive all kinds of mouse events.
This is a normal Thing, and can have other things added to it. See the help for Thing and Timeline.
These events are fired. Catch them by defining a def with one of these names.
Define a drawHitarea method where you then draw (using paths, not stroked or filled) the hit area.
The signature is: def drawHitarea(self,context,frame_number)
Typical use:
class Touchy(HitThing):
def __init__(self,x, y): # this is up to you
## Init the class - very important.
HitThing.__init__( self, id="button" )
self.keys( "#", Props() )
def onRollOver(self,x,y):
print "You are in ",x,y
def drawHitarea(self,ctx,fr):
ctx.rectangle(0,0,50,50) # this rectangle will be the hit-area
.
| 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 |