Apologies if this is trivial to do or has already been covered but I’m struggling to find a way to do something with the UI. Our artist wants to make all the buttons different sizes. We are rendering them 100% size in the game to get best quality. So it would make my life much easier if there was some way to set the button extent to the size of the graphic. Because my buttons are all defined in styles this is currently tricky to do , I have to maintain a seperate texture pointer for each button so I can get it’s extents and then pass them into the button code along with the style. It’s really tedious and error prone.
So is there a way to get the button extent to automatically match the native size of the button graphic? And if not I think it’s something which should be added to future versions of Unity as it’s a very useful thing to be able to do.
Actually I was just thinking I can probably get the texture for the button, and hence the extents, out of the style if I knew how to reference it?
regards,
Tony Oakden