I made a little module of convenience functions to help draw lines, shapes, and text for visual debugging. The render “draw_line” and “draw_text” messages are really long and cumbersome to type, so this wraps them up and makes things simple. It’s not an exhaustive shape-drawing library, just enough to draw a few different kinds of indicators and things.
You can use it as a library dependency with the following link, or just grab the lua file and drop it in your project wherever suits you.
https://github.com/rgrams/debug-draw/archive/master.zip
See the Readme on github for documentation (though it’s all pretty straightforward).
A set of convenience functions for drawing debug lines, shapes, and text with Defold.
25 Likes
Pawel
August 29, 2019, 8:20am
2
Add it to our asset portal, it’s great and convenient
2 Likes
Yeah I know. Since the dashboard’s going to be removed and the asset portal shuffled around in a few weeks I figured I might as well wait.
3 Likes
Ragetto
December 24, 2020, 12:20pm
4
Hello!
I just discovered your library, it looks soooo convenient!
I just followed the instructions here (Working with library projects in Defold ), but… can’t make it work
The library seems to be properly installed:
But this simple line…
debugdraw.circle(100,100,100)
(in the “update” function)
… generates an error message:
Did I miss something?
Rag’
1 Like
How do you “require” the Lua module?
1 Like
Ragetto
December 24, 2020, 1:29pm
6
require "debug-draw.debug-draw"
1st line of the same script
1 Like
Then you’ll get the variable “debug-draw”, and not the “debugdraw” as you wrote.
Try this instead:
local debugdraw = require("debug-draw.debug-draw")
4 Likes
Ragetto
December 24, 2020, 1:48pm
8
Oh ok… As you expected, it works
Thank you very much Ross for this super useful library, and Mathias for the help!
2 Likes
Thanks Mathias for helping out. I’ve added a line about this to the readme.
2 Likes