GUI Labels Overlap
hey So here is the thing... I have this only custom script in my code:
private void OnGUI()
{
guiStyle.fontSize = 50;
guiStyle.normal.textColor = Color.white;
if (GUI.Button(new Rect(490, 110, 200, 90), "Reiniciar"))
{
Debug.Log("entrei em reiniciar");
cont = 0;
Debug.Log("Cont = " + cont);
b1 = b2 = b3 = b4 = t1 = t2 = t3 = t4 = t5 = t6 = t7 = t8 = false;
enabled = false;
}
else if (GUI.Button(new Rect(490, 2, 200, 90), "Sair"))
{
Application.Quit();
}
//
if (cont == 1)
{
Debug.Log("cont = "+cont);
txt = (cont + " par encontrado");
}
else {
Debug.Log("cont = " + cont);
txt = (cont + " pares encontrados");
}
//
// if (cont == 1) GUILayout.Label(cont + " par encontrado", guiStyle);
// else GUILayout.Label(cont + " pares encontrados", guiStyle);
//if (cont == 4) GUILayout.Label("\n\nTodos os pares\nforam encontrados", guiStyle);
enabled = false;
GUILayout.Label(txt, guiStyle);
enabled = true;
}
}
I change cont in the update method, that also calls OnGUI() in the end The labels start to overlap when I click in the 'Reiniciar' button
Can anyone help me?
Thanks in advance
Comment