+1 vote

I tried like these:
1. add a GridContainer node to "ui" node
2. add a RichTextLabel node to "ui" node, set some text, make sure it could be displayed
3. move the label to grid container and run again

the label could not be displayed on screen.
I tried normal label too, seemed no such problem, is there something I missed?

in Engine by (30 points)

1 Answer

+2 votes
Best answer

I am pretty sure it is because the GridContainer arranges its children automatically, so you need to define a minimum size on your RichTextLabel.

by (306 points)
selected by

it works! thanks very much

You can also play around with the "Size Flags" to make your label expand itself so if you change the size of the GridContainer dynamically the label will resize itself

Other than normal Label the vertical size flag of a RichTextLabel is set to Shrink Center as the default value - at least on Godot 3. When set to Fill it adapts to the grids size.

Don't know why.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.