- Home /
How do I scale GUI Text but while keeping it "pixel correct"?
I basically want to be able to do a scale animation on some text, but I need it to act like I checked the "pixel correct" box. Does anyone know the formula behind "pixel correct" or how it factors specifically into scale?
Answer by chuchushoe · Jul 21, 2013 at 06:30 AM
Try this! In the import settings of the font, make the size very large like 100. Then you can uncheck the pixelcorrect without losing the text quality too much!
Ok yeah so this actually works, so why isn't it being accepted?
Answer by felixwcf85 · Mar 06, 2013 at 08:56 AM
I have the same problem too... This question is still left unanswered? I thought it was an esay one for pro?? Anyone please help?
What I ended up doing was not using the pixel correct option. I never needed it anyway, but I think there's enough flexibility to where you could make your own "pixel correct". If you do try your own version, don't forget to convert Screen.width/height to floats before doing any math operations. It took me a while to realize they were ints on my latest project.
Answer by robertbu · Mar 06, 2013 at 04:44 PM
GUIText uses a bitmap to display the font. When you import a font into Unity, you specify a font size. It generates a bitmap of that font at the specified size. "Pixel Correct" means that the images are not stretched in any way...there is one pixel on the screen for every pixel in the original font. So you cannot scale a GUIText and still have it pixel correct.
I don't use GUIText. I use the text system inside EZGUI, but the method used is similar. Through some experiments, I found in EZGUI the font can be scaled down some without losing much quality. Scaling up the quality degraded in a hurry. Do your own experiment with GUIText. Import your font in a variety of sizes and then scale the font up and down at runtime. I found it beneficial to have it on two of the same devices at the same time so I could compare scaled and not scaled text of a similar size.
Your answer
Follow this Question
Related Questions
How can I add "..." to GUI.Label if it goes past its bounds? 1 Answer
Checking 2 string variables 0 Answers
How to make text that scrolls horizontally? 2 Answers
Story Text to GUI Boxes 0 Answers
Trying to make an ASCII UI based game 0 Answers