I have some code that I am moving from Unity 3.5 to Unity 4. In the original code I have a simple textfield that worked the way I wanted. The text would basically hide when it was at the edges of the rectangle passed in. However, in Unity 4 I see that when I type enough letters to start filling the rect the text just stays on screen and goes outside the bounds I want it to have. Is this an “official” change in Unity 4 or is there something I am missing? Thanks.
function OnGUI(){
if(showTextArea){
if (Event.current.Equals (Event.KeyboardEvent ("return"))){
this.enterBtn();
}
var myFont :GUIStyle = new GUIStyle();
myFont.font = largefont;
myFont.fontSize = 20;
myFont.normal.textColor = Color.white;
GUI.skin.settings.selectionColor = Color.gray;
GUI.SetNextControlName("labelString");
labelString = GUI.TextField(Rect(20,Screen.height - 36, 100, 30),labelString,myFont);
GUI.FocusControl("labelString");
}
}