• Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.

    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

Advice for a graphical drawing application which tools to use?


New Coder
Hi, I am a hobby programmer and my main subject is alternative music notation. I want to write a program that can draw PianoScript music notation. Previously I did write in python and used Tkinter canvas to draw the notation.

I want to try to use Lua for the project because of the way I normally program and I love its simplicity of it.

I am wondering if I can use love2d for the purpose of generating a drawing and exporting it to pdf?

The virtual paper should be able to draw vector drawings:
- draw lines
- draw a circle/oval
- draw rectangle
- export the drawing to pdf in some way

What GUI library can I use with Lua that is able to draw vector drawings and export them to pdf? I read the page with GUI libraries but I can not find if this particular purpose is supported. I want to make sure it's possible before learning a whole new system and then discovering I am in the wrong place maybe... Any help is appreciated :)


King Coder
Hey there,

What you're planning to do isn't really Lua's intended purpose but it is possible either way(see Zerobrane for a full-blown Lua application).

For the GUI library, the only one for Lua I'm aware of is wxLua which will let you construct a GUI using Lua(it hasn't been updated in a long time now but it should still work). I have no experience with it though. As for Love2D, I can't find anything so far on the wiki which would allow you to export a vector image, so try having a look about yourself - all of the different .

I have no experience with building such a program, but I'm going to assume that to make this work, you'll need to connect the two libraries together in a way that will allow a button(e.g. draw a circle) to send a signal to Love2D that will let you draw the graphic, and once you do that, try and connect it in a way that will let you save the drawn graphic as a file. I think that's how it should go anyway...Alternatively, wxLua might actually have functions which allow you to draw graphics without needing to rely on Love2D - it's a very long list and you'll need to play about with some of them, but try reading here.

I hope this helps!