Hi does anyone know why my text isn't staying inside the buttons? I have wrap, truncate and best fit checked.
I have tried so many combinations of settings and haven't found a solution yet.
Any help would be much appreciated.
You can see what I mean in the bottom two player response buttons on this experiment.
text not staying inside buttons
text not staying inside buttons
- Attachments
-
- buttonss.jpg (348.18 KiB) Viewed 165 times
Re: text not staying inside buttons
Hi,
You may need to add some padding on the top and bottom of the button. Here's an example:
This button happens to use a Vertical Layout Group. Notice that the Top and Bottom padding move the text in from the top and bottom edges of the button image. Otherwise the text would overlap the top edge of the button image.
If you're not using a Vertical Layout Group, you can inspect the text GameObject itself and instead of the padding of its Rect Transform instead.
In addition, it will help to set the text's vertical alignment to middle instead of top.
You may need to add some padding on the top and bottom of the button. Here's an example:
This button happens to use a Vertical Layout Group. Notice that the Top and Bottom padding move the text in from the top and bottom edges of the button image. Otherwise the text would overlap the top edge of the button image.
If you're not using a Vertical Layout Group, you can inspect the text GameObject itself and instead of the padding of its Rect Transform instead.
In addition, it will help to set the text's vertical alignment to middle instead of top.