Hey guys,
I have a menu that basically pops up to explain to the player what to do next, the label is a global variable. However, I'd like the background for that label to expand depending on how long the string is. For example if I just put in a graphic and then put the variable in front of it, some shorter strings might work, but some longer strings might overlap the graphic box and obviously not fit into it. If I just made a really long graphic then the shorter strings would just have a huge background graphic that looks empty.
So if I had a huge string then the graphic would expand to fit the text into it, or if the text was short then the graphic would be shorter too.
Do you have any idea how I could do this?
Thank you!
Comments
Connecting the Menu Manager to a Unity UI canvas is covered in this tutorial. Once the connection is made, actually getting the resizing effect will be down to Unity UI, but a search of Unity's docs / google can get some advice on that quite readily.