Is there no simple way to change GUIText font size? Currently the text size looks nice in iPhone screen but when it comes to Retina Display, it becomes very small. I’ve looked for solutions but it seems GUIText.fontSize is only for dynamic fonts. Is there any other way to adjust the font size from the script without having to create custom font? Thanks in advance! =)
Edit: To make things clearer, these all are the steps I’ve done:
Script part:
private var infoText:GUIText;
private var theFont:Font;
var fonts:Font[];
function Awake(){
infoText = GameObject.Find("Info").GetComponent(GUIText);
infoText.enabled = false;
}
function OnGUI(){
if(iPhoneGeneration.iPhone3GS){
theFont = fonts[0];
}else if(iPhoneGeneration.iPhone4){
theFont = fonts[1];
}
}
function PostScore(){
.
.
if(hs_post.isDone){
infoText.text = "Score uploaded";
infoText.font = theFont;
infoText.enabled = true;
}
}
function CheckUsername(){
if(userName.Length == 0){
infoText.enabled = true;
infoText.text = "Please put your username";
infoText.font = theFont;
}
}
Those are where I access the “infoText” from the script
For the settings:
I hope I didn’t miss anything.
Just import a custom font. Chances are it'll look better anyway.
Yeah the "Font size and style overrides are only supported for dynamic fonts" message means that somewhere in your code...or more likely in one of your GUIStyles you are trying to change the font size. Check all your GUIStyles and make sure their font size is set to 0 to make sure they are using the size you set when you imported the font.
Seems that Unity 4 (probably in August 12) will solve the problem.
One little but great feature:
“* Dynamic fonts on all platforms with HTML-like markup”
see: GlobeNewswire Press Release Distribution
hopefully …
Seems that Unity 4 (probably in August 12) will solve the problem.
Just one little but great feature of all: " Dynamic fonts on all platforms with HTML-like markup"
see: GlobeNewswire Press Release Distribution
hopefully …
Just import a custom font. Chances are it'll look better anyway.
– syclamothYeah I have the same problem with various android devices and the best way I have found is to import a custom font for each.
– anon60085663This was sort of already covered in this answer: http://answers.unity3d.com/questions/20599/how-do-you-increase-gui-text-font-size-.html And this link to docs could be helpful: http://unity3d.com/support/documentation/Components/class-Font.html
– anon60085663Yeah the "Font size and style overrides are only supported for dynamic fonts" message means that somewhere in your code...or more likely in one of your GUIStyles you are trying to change the font size. Check all your GUIStyles and make sure their font size is set to 0 to make sure they are using the size you set when you imported the font.
– anon60085663