- Home /
I need to resize my text to button to be visible using Unity 4.6 UI
Hi guys....ok so the thing is that whenever i scale my button to a small size the text shrinks which makes the text somewhat hard to read....i want to resize my buttons to a smaller size but want to make the text still readable.....is there a way to move the interaction/interactable property from the text of the button so that i may resize the text without worrying about the click out of the button bounds.
As you can see the second pic is good....but whenever i resize it the text resizes.....in short i want the same text size on the other button aswell since i want many many buttons and its for an android phone .
Thank you :)
Answer by Mmmpies · Dec 14, 2014 at 01:01 PM
I guess that's an image you're using and not text because text wouldn't scale.
Try re-sizing the button then adding the text image and tick preserve aspect ratio. If the image has a lot of empty space at the edges try cutting it down with an image editor so the text in the image fills almost all the image.
hope that helps.
EDIT:
Sorry I went out so only just got this. What are the settings in the Text component of your Button?
This is the Text component for a button I just placed on my Canvas. If I scale the button to be thinner the Text stays the same size if I make it really thin then all I can see is the B but it's still the same size.
I wonder if it treats different font types differently.
no thats a text basically i converted it online .... its a text not an image... thank you but if you have anything related on how resize the text in the button i would love to hear that
thank you :)
What if you check the "Best Fit" checkbox?. Have you tried that?
Thank you guys but still i havent figured how to resize it properly :(
Answer by Kiwasi · Dec 16, 2014 at 01:44 AM
whenever i scale my button
There is your problem. UI elements are not meant to be scaled. Rather you should adjust the size of the RectTransform.
(Note: It does make sense to scale world space canvases. But this should be done once, and evenly on the canvas. Everything else should be by size.)
Answer by UNZoOM · Mar 19, 2015 at 10:55 PM
Once you scale the button to the desired size. You can then scale the Text ( i.e "Scale the Rect Transform property" under inspector of the selected text ) size to a clearly visible size.
Original(Default) Size
Smaller Size