I am thinking that this doesn’t work because, the style I entered to the Label is local and doesn’t update…
using UnityEngine;
using System.Collections;
public class Menu : MonoBehaviour {
void Start () {
if (Screen.height < 1024) {
if (Screen.width < 768) {
Screen.SetResolution (1024, 768, true);
}
}
}
void Update () {
}
IEnumerator wait(float waiting)
{
yield return new WaitForSeconds(waiting);
print ("Waited" + " " + waiting);
StopCoroutine ("wait");
}
void OnGUI () {
var height = Screen.height;
var width = Screen.width;
int a = 3;
GUIStyle desire = new GUIStyle();
desire.fontSize = a;
desire.wordWrap = true;
desire.fontStyle = FontStyle.Bold;
GUI.contentColor = Color.white;
GUI.Box (new Rect(0, 0, width, height), "");
GUI.Label (new Rect(width/2, height/2, height, width/50), "Ripe games", desire);
while (a < 31) {
StartCoroutine (wait(1));
a++;
desire.fontSize = a;
}
}
}