How can I make a textfield that works when its in a gui using a GUIskin?
When using a GUIskin I can delete the text but not enter a new text, when I remove the GUIskin it works just fine.
Can you post the code you are using for this?
Extracted this from my code, when I assign the gui skin in the inspector i can delete text but typing new text casues the error:
@script ExecuteInEditMode()
var gSkin : GUISkin ;
private var optionsMenu : boolean = true;
private var playerName : String = "Rollie Wollie";
private var showHints : boolean = true ;
private var showFPS : boolean = false ;
//-----------------------------------------------------
//
//-----------------------------------------------------
function OnGUI()
{
if (gSkin)
{
GUI.skin = gSkin ;
}
else
{
Debug.Log("StartMenuGUI: GUI Skin missing!") ;
}
if (optionsMenu)
{
ShowOptionsMenu() ;
}
}
//----------------------------------------------------------------
// OPTIONS menu.
//----------------------------------------------------------------
function ShowOptionsMenu()
{
GUI.BeginGroup (Rect (Screen.width / 2 - 512, Screen.height / 2 - 384 , 1024, 768));
// show the group area, must be as big as the begingroup setting
GUI.Box (Rect (0,0,1024, 768), "Group is here");
// ROW 1
GUI.BeginGroup (Rect (100, 250, 240, 348));
// NAME
GUI.Label (Rect (0, 0 , 300, 30), "Player name: " ) ;
playerName = GUI.TextField (Rect (0 , 30, 200, 25), playerName);
// HINTS
showHints = GUI.Toggle (Rect (0, 60, 200, 30), showHints, " Show hint objects");
// FPS
showFPS = GUI.Toggle (Rect (0, 90, 200, 30), showFPS, " Show framerate");
// no }
GUI.EndGroup ();
// ROW 2
GUI.BeginGroup (Rect (390, 250, 240, 348));
//GUI.Box (Rect (0,0,240,348), "Group is here");
// no }
GUI.EndGroup ();
GUI.EndGroup ();
}
Fixed, creating a guiskin does not set a font for textfields.
edit for some reason the Arial Rounded Bold font also breaks it, is that the default font perhaps?