GUI TEXT looks smaller on higher resolutions! HELP!

Hello, first of all thank you for clicking on this.

I’ve made a scoring system for my game that is brought to “life” using GUI TEXT, unfortunately, on my high resolution HTC One, or any other high resolution phone, the text looks smaller, and on low resolutions, the text looks bigger.

Is there a way I could keep the proportions on any resolution, just like the 3d text does?

thank you very much!

the script:
using UnityEngine;
using System.Collections;

public class PlayerScore : MonoBehaviour {
	
	
	
	public int score {
		
		get;
		
		private set;
		
	}
	
	
	
	public int bestScore {
		
		get;
		
		private set;
		
	}
	
	
	
	private Vector3 startPosition;
	
	
	
	void Awake() {
		
		
		
		startPosition = transform.position;
		
		bestScore = 0;
		
	}
	
	void OnGUI() {


		
		GUI.color = Color.black;
		
		GUILayout.Label("Score: " + score.ToString());
		
		GUILayout.Label("Best Score: " + bestScore.ToString());
		
	}
	
	
	void Update() {
		
		
		
		score = Mathf.RoundToInt(Mathf.Abs(transform.position.x - startPosition.x));
		
		bestScore = Mathf.Max(score, bestScore);
		
	}

}

If you were using a GUIStyle for your labels, you could set the font size in the editor, or dynamically within the script.

For example:

public GUIStyle myStyle;

void OnGUI() {

    myStyle.fontSize = 40;

    GUILayout.Label("Score: " + score.ToString(), myStyle); 
}

This example uses a simple value of 40 for the size, though you could use the current screen resolution to determine the actual value to use. Also you probably wouldn’t want to set it every gui frame in OnGUI, I’ve just done that here for clarity.

Here’s an example of how you might determine the size on any resolution. When building my GUI’s I assume a default resolution height of 1080;

float screenRatio;

Start () {
    screenRatio = Screen.height / 1080.0f;
    myStyle.fontSize = Ratio ( 40 );
}

int Ratio( int pixelHDValue ) {
   return Mathf.RoundToInt( pixelHDValue * screenRatio );
}