Poki Nanpa: A Toki Pona programming language

Development blog for Jack Mullin's graduation project.

sitelen lon lipu; Drawing on the canvas

| 0 comments

Initially the program was interacting directly with the HTML svg element to draw pixels. This worked fine, but for easier manipulation of the canvas as I start adding more advanced program features, I wanted to have an array of pixels that I could change programmatically, which would then be pushed to the canvas element as needed.

This also gave me the opportunity to implement the user being able to draw on the canvas directly. That’s now working great. Here’s some “art” I drew during testing:

A more interesting side effect of this is that I didn’t just make a 2D array; I made a 3D array. The canvas has layers, and the cursor will be able to traverse through them just like it can traverse in the other two dimensions. This means that programs can potentially store data, or even sprites, on other layers for copy-pasting to the visible layer during execution. This has a lot of potential applications, and gives users a way of storing data considering Poki Nanpa has no variables.

Leave a Reply

Required fields are marked *.