Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DrawLib is an open-source vector drawing library for Mnemonimov, written in misa.

Why open-source

Creating a full vector drawing library, with every feature imaginable, would take an incredible amount of time for just one person to make. Therefore, I'm creating this project so that you can add functionality to a standard library easily.

Current features

  • Pixel-aligned-centre circle drawing
  • Line drawing using Bresenham's algorithm

Feel like there should be more on this list? Consider creating an issue with your idea for functionality, or you can even create it yourself, open a pull request, and it might be added straight into this repository.

How to use

Download

To download DrawLib, you can:

  • Click the green button titled 'code', and select 'Download ZIP',
  • Unzip the folder
  • Find the file under <root>/source/DrawLib.misa
  • Copy and paste the contents into your Mnemonimov project, ideally at the top of the project.

Or just simply copy and paste the code from github directly.

Calling Functions

To call a DrawLib function, simply put values into the correct argument registers, then use the cal instruction with the function.

These functions may be under categories like Circle or Line, so make sure you use those global labels, as well as the local labels of the function.

A function call may look like:

# load each argument
mov a0, 50
mov a1, 50
mov a2, 150
mov a3, 100
cal Line.DrawLine # <Global label>.<Local label>

Setting the fill colour

Individual functions don't have a colour parameter, instead you need to set the fill colour manually.

To do this, set State.FillColour to a luma value (0-255):

str u8t, <colour>, State.FillColour

About

An open-source vector drawing library for Mnemonimov

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors