RichTextLabel does not show in GridContainer

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By fliar
:warning: Old Version Published before Godot 3 was released.

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?

:bust_in_silhouette: Reply From: Rasmus

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

it works! thanks very much

fliar | 2017-06-20 01:56

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

Rasmus | 2017-06-20 07:18

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.

rolfpancake | 2017-12-07 13:21