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

Add DebugLabel node #49

Merged
merged 1 commit into from
Feb 9, 2020
Merged

Add DebugLabel node #49

merged 1 commit into from
Feb 9, 2020

Conversation

Xrayez
Copy link
Contributor

@Xrayez Xrayez commented Dec 8, 2019

Helps godotengine/godot-proposals#115.

A label which displays a list of property values in any Object instance, suitable for both in-game and editor debugging of nodes.

The implementation is fairly straightforward. I've done some attempts on color coding variant types with RichTextLabel but there are usability issues with having to set minimum size manually for each label for the contents to be displayed.

Re-implementing the internal Label functionality just to achieve this seamless display of text with custom colors seems like an arduous task to do via script currently. Even if one manages to draw stuff with font.draw_char or draw_string, there are still many aspects to account like font character spacing, line spacing etc. var2str is used over String() conversion which converts any Variant to text in a consistent way at least (and can even be parsed back with str2var if you manage to copy-paste the debug label contents, which is possible in RichTextLabel btw).

Works in 3.1 and 3.2.

Test project

godot-debug-label.zip

A label which displays a list of property values in any Object instance, suitable for both in-game and editor debugging.
@willnationsdev
Copy link
Member

@Xrayez Thanks!

@willnationsdev willnationsdev merged commit 21753fb into godot-extended-libraries:master Feb 9, 2020
@Xrayez Xrayez deleted the debug-label branch February 9, 2020 21:37
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

Successfully merging this pull request may close these issues.

2 participants