Positioning a button next to a textbox of variable dimensions #411
-
I've got a situation where I'd like to provide the player with the option to "favorite" a character. I'd like for the "favorite" button to be positioned right next to the character name. The character is named by the player, however, and so can be any length. Additionally, the name needs to be centered on the screen. I know I can allow the text box to change according to the length of the text inside it by setting the x dimension to -1, but I'm unsure of how to find the dimension it calculates so that I can pass it to the button and update it's positioning to keep it from overlapping the text. There's also the added variable of needing to keep all of this centered on the screen. Is this something that would be achievable or should I just find a different place to put my button ^^; |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
A friend informed me that get_relative_rect() should work for this! So nevermind this question haha |
Beta Was this translation helpful? Give feedback.
A friend informed me that get_relative_rect() should work for this! So nevermind this question haha