Hi.
I’m creating simple GUI (for main menu) and I have problem with TextLabel. All work fine, but when I’m click some key in TextLabel I get error:
My Main Menu.js looks that:
var mySkin : GUISkin;
var backgroundIMG : Texture2D;
var logoIMG : Texture2D;
var userName : String = "";
function OnGUI () {
GUI.skin = mySkin;
// TŁO
var backgroundStyle : GUIStyle = new GUIStyle();
backgroundStyle.normal.background = backgroundIMG;
GUI.Label ( Rect( 0, 0, Screen.width , Screen.height), "", backgroundStyle);
// LOGO
var logoStyle : GUIStyle = new GUIStyle();
logoStyle.normal.background = logoIMG;
GUI.Label ( Rect( Screen.width/2-250, 0, 500, 250), "", logoStyle);
var windowRect : Rect = Rect (Screen.width/2-200, Screen.height/2-150, 400, 150);
windowRect = GUI.Window (0, windowRect, WindowFunction, "Logowanie");
}
function WindowFunction (windowID : int) {
GUI.Label (Rect (30, 40, 100, 30), "Login:");
GUI.Label (Rect (30, 80, 100, 30), "Pass:");
userName = GUI.TextField (Rect (130, 40, 100, 30), userName);
GUI.DragWindow(Rect (0,0,10000,10000));
}