Hello everyone!
So recently I was experimenting with UI elements. For some reason, text elements disappear after a certain font size is reached. How do I fix this?
There are two things to consider when working with the size of UI elements.
One is the font size, which is what you’re changing. Easy enough.
The other is the RectTransform of the element. All UI elements have a RectTransform that determines their size and positioning on the screen. This size (units are in reference to the size determined by the CanvasScaler component on your Canvas) is the maximum size your element can be. So if your font-size is 50 and your element’s height is only 40, your text is going to disappear since the default behavior is to hide overflowed text on elements.
To ensure your text is visible, set the font-size to less than or equal to the height of the element or set the Text’s Horizontal/Vertical Overflow property to Overflow as appropriate.
this didn’t work for me
Hey, welcome to the forums. Would you care to provide a bit more information other than what I said not working? Maybe share a screenshot of your Inspector panel with the problematic UI element selected.