GDMYDebug - On-screen Debug Text Module (C++ module)

I’m fairly new to Godot, and one thing I noticed was that there didn’t seem to be a simple way to display debug text directly on the game screen.

After looking around, I found some existing solutions, but they generally require setting up an Autoload or making some changes to the project structure. Personally, I found that a bit inconvenient, especially for something as simple as displaying a few lines of debug information.

So I decided to make my own little solution: GDMYDebug.

It’s implemented as a native Godot Engine Module, so it doesn’t require an Autoload or any changes to the project scene. You can just build Godot with the module and use the debug functions directly.

It’s still very much a small personal experiment, and there may be some weird problems or questionable implementation decisions. I haven’t encountered any major issues so far, but I wouldn’t consider it production-ready.

If you’re interested, you can check it out here:

(Personally, I’d actually prefer if Godot eventually provided something like this officially)

Just asking to understand better: What about Dmitriy Salnikov’s godot_debug_draw_3d, does that not have what you want?

I tried the addon after seeing your comment, and I think I understand the difference better now.

It can definitely display debug text (DebugDraw2D), but its 2D text API seems to be more oriented around a text block/overlay. For example, changing DebugDraw2DConfig’s text_block_offset and calling set_text() again seems to add the text to the same block, rather than letting me place each individual string at an arbitrary screen position.

What I was looking for was something more like:

# print the text at (50, 50)
Debug.set_print_pos_xy(50, 50)
Debug.print("(50, 50)")

# print the text at (50, 100)
Debug.set_print_pos_xy(50, 100)
Debug.print("(50, 100)")

where each call can independently specify its screen-space position.

So DebugDraw3D definitely has a lot of the functionality I was looking for, but its 2D text API isn’t quite the interaction model I had in mind.

1 Like