Please help,how can I scale and position the GUI according to the screen resolution. GUI just changes the position and is located in some random position.HELP!
Here is my script please help me:
GUI.Label (Rect((Screen.width / 2) - 38, 12, 140, 40), displayText);
GUI.color = Color.red;
GUI.Label(new Rect(Screen.width / 2 - 78, Screen.height / 25 - 12, 140, 40), "Time :");
Have you read how to use GUI.Label? This bit : (Rect(1,1,1,1)) in particular?
The first two numbers are the position. So in yours, that’s where you’ve got
Rect((Screen.width / 2) - 38, 12,140,40)
So your (Screen.width /2) - 38 is your x position, the 12 is your y position.
The next two numbers are your scaling properties. One scales the x-axis, the other the y-axis of the label. Here yours is 140 pixels wide, and 40 pixels high.
And what do you mean by ‘is located in some random position?’ We need more information.