debug-draw icon indicating copy to clipboard operation
debug-draw copied to clipboard

Any way this can work on the GUI space?

Open Blankeos opened this issue 1 year ago • 1 comments
trafficstars

I know it draws on world space at the moment. Any way it can work in the GUI space? Would be useful to debug GUI-space coordinates. Thanks in advance!

Awesome work on this btw!

Blankeos avatar Oct 07 '24 23:10 Blankeos

Hmm, sort of. You can change it to screen space, by editing the render script. Simply move this line

render.draw_debug3d()

down to just below the GUI drawing functions. With the current default render script it would look like this:

render.draw(predicates.gui, camera_gui.frustum)
render.draw(predicates.debug_text, camera_gui.frustum)
render.draw_debug3d()

However, this is just absolute coordinates within the window, it won't have all the scaling stuff that GUI coordinates have. Also, it will break the physics debug drawing, since that's done in the same .draw_debug3d() call (both 2D and 3D).

If you are having trouble with GUI coordinates then it's probably better to just add some extra nodes to use for debugging. Their actual position and size will depend on their adjust mode.

rgrams avatar Oct 11 '24 11:10 rgrams