Public Member Functions | |||
def | __init__(self, reference=None) | ||
def | addHandler(self, handler) | [Inherited from _EventTrigger] | |
def | adjustReference(self, dx, dy) | ||
def | clone(self) | ||
def | flip(self, angle=0) | ||
def | getDepth(self) | ||
def | getReferencePoint(self) | ||
def | move(self, dx, dy) | ||
def | moveTo(self, x, y) | ||
def | removeHandler(self, handler) | [Inherited from _EventTrigger] | |
def | rotate(self, angle) | ||
def | scale(self, factor) | ||
def | setDepth(self, depth) | ||
def | shear(self, shear, angle=0) | ||
def | stretch(self, xFactor, yFactor, angle=0) | ||
def | wait(self) | [Inherited from _EventTrigger] |
An object that can be drawn to a graphics canvas.
def __init__ | ( | self, | ||
reference = None | ||||
) |
Create a Drawable instance. referencePoint local reference point for scaling, rotating and flipping (default Point(0,0) )
Reimplemented in Shape, FillableShape, Path, and Polygon.
def addHandler | ( | self, | ||
handler | ||||
) | [inherited] |
Register an EventHandler instance with this object.
def adjustReference | ( | self, | ||
dx, | ||||
dy | ||||
) |
Move the local reference point relative to its current position. Note that the object is not moved at all.
def clone | ( | self | ) |
Return a duplicate of the drawable object. Note that the duplicate is not automatically added to any canvases or layers, even if original is currently so.
def flip | ( | self, | ||
angle = 0 | ||||
) |
Flip the object reflected about its current reference point. By default the flip is a left-to-right flip with a vertical axis of symmetry. angle a clockwise rotation of the axis of symmetry away from vertical
def getDepth | ( | self | ) |
Return the depth of the object.
def getReferencePoint | ( | self | ) |
Return a copy of the current reference point. Note that mutating that copy has no effect on the Drawable object.
def move | ( | self, | ||
dx, | ||||
dy | ||||
) |
Move the object dx units along X-axis and dy units along Y-axis. For the default coordinate system, positive dx is rightward and negative is leftward; positive dy is downard and negative is upward.
def moveTo | ( | self, | ||
x, | ||||
y | ||||
) |
Move the object to align its reference point with (x,y)
def removeHandler | ( | self, | ||
handler | ||||
) | [inherited] |
Unregister an EventHandler instance from this object.
def rotate | ( | self, | ||
angle | ||||
) |
Rotate the object around its current reference point. angle number of degrees of clockwise rotation
Reimplemented in Text.
def scale | ( | self, | ||
factor | ||||
) |
Scale the object relative to its current reference point. factor scale is multiplied by this number (must be positive)
Reimplemented in Text.
def setDepth | ( | self, | ||
depth | ||||
) |
Set the depth of the object. Objects with a higher depth will be rendered behind those with lower depths.
def shear | ( | self, | ||
shear, | ||||
angle = 0 | ||||
) |
Shear the object relative to its current reference point. By default, points with the same y-coordinate as the reference point are left unchanged. A point d units above the reference point is shifted d * shear units to the right. The optional angle parameter rotates the axis that the shearing occurs along. angle clockwise angle for shear
def stretch | ( | self, | ||
xFactor, | ||||
yFactor, | ||||
angle = 0 | ||||
) |
Stretch the shape in mutltiple direction. By default the x-axis is scaled by a factor of xFactor and the y-axis is scaled by a factor of yFactor. The optional parameter rotates the directions that the streching is performed along.
def wait | ( | self | ) | [inherited] |
Wait for an event to occur. When an event occurs, an Event instance is returned with information about what has happened.