Is there a way to rotate text?

I’m working on a game where I have to display Japanese text vertically.

Previously while working in Unity I handled that by rotating text container by -90 degrees and then counter rotated the font for 90 degrees to achieve the vertical flow of the text.

Now I’m trying to find a way to achieve this in Godot, but not finding a good way to achieve this. Even tried simply splitting text into rows and the ncreating rows of vertical text, but that doesn’t achieve the good results as not all characters are equal width.

Is there some recommended way how to show text vertically in Godot?

I don’t think labels support vertical text.
You could get vertical text by using Hozizontal Alignment to Center and Autowrap Mode to Word smart (that way, you can even add spaces if you want)
image

And also set theme overrides to add a negative line spacing so the text stays reasonably together.
image

The downsize is that you can’t just type the next line. Each line needs to be a separate label with a very small width.

1 Like

Hi, sprry for late reply as I was trying to consider how good of a solution this would be.

Definitely there is a drawback that each line has to be separate label, but probably better than reshuffling the whole text to appear vertical. Plus this might be a good way to add some combination logic to add furigana as well.

Thanks for the suggestion

Vertlcal text is supported but it’s not exposed in Label or RichTextLabel You’ll need to write your own Control to support it and use CanvasItem.draw_string() or CanvasItem.draw_multiline_string() setting the Orientation parameter to TextServer.ORIENTATION_VERTICAL

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.