I am trying to add a background image to my portrait name... but since I really dont understand half of the Unity UI system, I figured I might as well write here... and it could perhaps help someone oneday that tries to do the same thing
As you can see in the picture below
PortraitNameFrame.jpg (31.89 KiB) Viewed 883 times
I created a framing for the name... it is positionned properly in SLICED mode... so I can adjust the width and it will stretch to the right side to acomodate super long character names... or contract to the left for much smaller names... I'd like to automate that "stretching" based on the character names... but I fear the template I am using might not work for that... Any tips/help you could provide on how I could achieve that?
As always, THANKS SO MUCH for all your amazing support!
Add a Layout Element component to PortraitName. You can leave all of the checkboxes unticked.
PortraitNameBackground:
Set the Rect Transform to Anchor: top left. Pivot X=0, Y=1.
Add a Horizontal Layout Group to PortraitNameBackground. Tick Control Child Size > Width; leave the others unticked. Set the Padding values if you want.
Add a Content Size Fitter. Set Horizontal Fit to Preferred.
2nd, i am getting the following warning after testing it...
Unexpected top level layout group! Missing GUILayout.EndScrollView/EndVertical/EndHorizontal?
UnityEditor.DockArea:OnGUI()