from mojo.drawingTools import *
Using similar tools to draw in Cocoa object like DrawBot. (see TinyDrawBot extension)
save the current graphic state
restore the current graphic state
- rect(x, y, width, height)
draws a rectangle
- oval(x, y, width, height)
draws an oval
creates a new path
- moveTo((x, y))
move to point
- lineTo((x, y))
line to point
- curveTo((h1x, h1y), (h2x, h2y), (x, y))
curve to point with bcps
close the path
draws the path
- fill(r, g, b, a=1)
Set the fill color as RGB value.
- stroke(r, g, b, a=1)
Set the stroke color as RGB value.
Set the stroke width for a path.
Set the miter limit for a path.
Set the line join for a path, possible join arguments are: "bevel", "miter" or "round"
dash is a list of of values
- translate(x, y)
Translate the art board pane to "x", "y"
Rotate the art board by an angle.
- scale(x, y)
Scale the art board by "x", "y", if "y" is not set the art board will be scaled proportionally.
- skew(a, b)
Skew the art board by "a", "b", if "b" is not set the art board will be skew with "a" = "b"
- font(fontName, fontSize=None)
Set the font by PostScript name.
Optionally set the font size.
Set the font size.
- text(textString, (x, y))
Draw a text on position "x", "y".
- image(filePath, (x, y), alpha=1)
Draw an image on position "x", "y".
Optionally set an alpha value.