I'm trying to make a dynamical resizing height dialog (the width will always be fixed). My control (dialog) has 1 background texture, a title (fixed maximum width), a text (fixed maximum width) and some buttons (OK, Cancel, Yes, No, etc).
Title type: Label
Text type: RichTextLabel
What I want to do:
1) Resize the background texture (the height) every time I set the title, the text and set the buttons:
var title_height = get_node("Title").get_line_height()
var text_height = ? (I need this information)
var total_height = top_margin + bottom_margin + dist_between_title_ and_text + dist_between_text_and_buttons + title_height + text_height
var texture_height = total_height.
2) Rearrange the buttons' positions by the size of the total height:
var buttons_pos_y = top_margin + dist_between_title_ and_text + dist_between_text_and_buttons + title_height + text_height
Please see in the above code what I need to find out (there's a question mark).
I looked in RichTextLabel class and I couldn't find nothing like
get_text_width() & get_text_height()
P.S. Both (title and text) controls have Dynamic Font (.ttf) set.