Skip to content

Some functions for making drawing in Numworks Calculators easier

License

Notifications You must be signed in to change notification settings

Emrio/numworks-drawing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

numworks-drawing

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.

Usage example

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)

Available methods

Options

stroke([r: Number, g: Number, b: Number]): Number
Set a color for the strokes. If no argument specified, it returns the current color

BasicShapes

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

ComplexShapes

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.

Limitations

This module doesn't currently support filling with colours

About

Some functions for making drawing in Numworks Calculators easier

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages