#Centering text in RichTextLabel
6 messages · Page 1 of 1 (latest)
You can use the [center] tags to center horizontally. RichTextLabel does not have an option for centering vertically though
is there another way to center vertically?
idk if this will work, but you could try putting the rich text label at the center of the textbox, then changing the grow direction to be "both"
https://docs.godotengine.org/en/stable/classes/class_richtextlabel.html#class-richtextlabel-property-fit-content-height just found godot docs have a workaround
Inherits: Control< CanvasItem< Node< Object Label that displays rich text. Description: Rich text can contain custom text, fonts, images and some basic formatting. The label manages these as an int...
"Note: Unlike Label, RichTextLabel doesn't have a property to horizontally align text to the center. Instead, enable bbcode_enabled and surround the text in a [center] tag as follows: [center]Example[/center]. There is currently no built-in way to vertically align text either, but this can be emulated by relying on anchors/containers and the fit_content_height property."