Think like a modal window opens and depending on it’s amount of text or buttons inside it resizes accordingly.
Any tutorial is appreciated too.
Thanks
Think like a modal window opens and depending on it’s amount of text or buttons inside it resizes accordingly.
Any tutorial is appreciated too.
Thanks
Lets take a simple example, add a panel to the canvas and add a Horizontal Layout Group. Untick the Child Force Expand for both width and height. Also add a Content Size Fitter and set Horizontal to preferred. Set padding left and right to 5 so the text has a bit of space around it (just personal preference though).
Add a Text UI element as a child of that panel and again add the Content Size Fitter and set Horizontal to Preferred.
Now when you add or remove text the whole panel will expand. Sure I came across someone working through a tutorial for a modal window that uses this for more complex boxes as well so maybe search for that video.