How to vertically center text in RichTextLabel?

Godot Version

Godot 4.3

Question

Just what it says in the title

Hi,

Try putting your label inside a VBoxContainer, aligned to center and expanded.
image


On the RichTextLabel (sorry my Godot at work is in French, but that should be okay):

Also, make sure that you check Fit Content:


Result:


I’m not sure there’s a better solution to do that, as least none that I know, and when I was looking for similar effect, the solution always seemed to be using containers.
May not be the more convenient, but I hope that works for you.

In Godot 4.4.x you can use RichTextLabel.vertical_aligment

In Godot 4.3 you’ll need to use what @sixrobin posted above or do it in a similar way.

1 Like