Questions about the new RichTextLabel methods

Nice to meet you all.
I am using Godot 4.5-Dev5.
I am looking forward to the new RichTextLabel features.
I tried using get_line_width and get_line_height.
The get_line_width worked as I wanted.
However, get_line_height does not return the value I want.

I specify a RichTextLabel node in a new project and code-attach it.
I did the following for the property text

abc
abcd
abcde

The code is as follows

func _ready() → void:
for i in get_line_count():
print(“w:”+str(get_line_width(i)))
print(“h:”+str(get_line_height(i)))

The result is as follows
w:28
h:23
w:38
h:23
w:47
h:23

Is the argument for get_line_height wrong?
Or is this the correct result?
I just want to display a click-waiting icon next to the text on the RichTextLabel.

It seems to work just fine as it’s giving you the height of that specific line. You could try using RichTextLabel.get_content_height() instead.

1 Like

Thanks, I understand what you mean by this method.