Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Darenn Keller |
Hey guys!
I’m trying to adjust a label.rect_size.x
(I’m making a dialog box) relative to the size of the a text inside a it. More precisely, I want the rect_size.x to be the minimum needed size to display the text. I’m using this code :
label.rect_size.x = label.get_font("mono_font").get_string_size(label.text).x
But the get_string_size()
returns a pretty small number and the text does not if in the label (letters are missing). Is the size returned in pixel? Maybe I’m not actually getting the good font? (I have a custom mono_font on my RichTextLabel, I did not find any other way to get the font from my label).
Thanks!