Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any way this can work on the GUI space? #1

Open
Blankeos opened this issue Oct 7, 2024 · 1 comment
Open

Any way this can work on the GUI space? #1

Blankeos opened this issue Oct 7, 2024 · 1 comment

Comments

@Blankeos
Copy link

Blankeos commented Oct 7, 2024

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!

@rgrams
Copy link
Owner

rgrams commented Oct 11, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants