Easier drawing on Numworks calculators
License | Project on numworks | Github | Author | Site
This project contains some methods for drawing on Numworks. It uses the calculator's default kandinsky
module.
from drawing import *
# Makes the strokes red
Options.stroke(255, 0, 0)
# Makes a 100x50 rectangle with the top left corner at 100-100 coordinates
BasicShapes.rect(100, 100, 100, 50)
stroke([r: Number, g: Number, b: Number]): Number
Set a color for the strokes. If no argument specified, it returns the current color
point(x, y)
Draws a pixel with the selected color
line(x1, y1, x2, y2)
Draws a line from the first coordinates to the other one.
rect(x, y, w, h)
Draws a rectangle with no fill. The coordinates provided correspond to the top-left corner
triangle(x1, y1, x2, y2, x3, y3)
Draws a triangle given three coordinates
circle(x, y, r)
Draws a circle given the circle's centre and the radius
setMode(mode: String)
Sets the drawing mode for complex shapes. Two modes available : ABSOLUTE
and RELATIVE
.
The RELATIVE
mode moves a cursor that starts at (0, 0)
when using move()
and line()
begin()
Begin complex shape
end()
Ends a complex shape
move(x, y)
Moves the current position to a given coordinate. If the mode is set to RELATIVE
, the cursor is moved to the coordinates relative to the previous position.
line(x, y)
Draws a line from current position to a given coordinate. This also moves the current coordinates.
This module doesn't currently support filling with colours