gdquest-demos / godot-kickstarter-2019

Create your Own Games with Godot, the Free Game Engine: sources from the January Kickstarter project from GDQuest
MIT License
242 stars 269 forks source link

Tool to resize RichTextLabel and TextEdit bounding boxes #28

Closed NathanLovato closed 5 years ago

NathanLovato commented 5 years ago

A contextual button and shortcut to resize selected TextEdit and RichTextLabel nodes based on their content. It should only show if you have one or more TextEdit or RichTextLabel node(s) selected, and update all selected nodes at once.

It doesn't work in real-time

I tried to hook onto the engine's setters, and I tried adding an extra property to force the node to resize upon setting the text, but the result is buggy. It seems get_content_size doesn't get computed instantly on RichTextLabel

There may be a way to hack realtime resize into TextEdit etc. but I don't think it's worth the work to just save a keystroke. If you make resizing a manual operation, you can use get_content_size as-is. So for this first iteration, a button and keyboard shortcut will do the trick.

henriiquecampos commented 5 years ago

Just to make sure I got it, the desired behavior is to mimic Label's when we have Label.clip_text = false ? Will there be a limit for its width and/or height? ezgif com-video-to-gif