When I test my game's twitter login view in the editor, the GUILayout.PasswordField() works as expected hiding every character immediately and revealing nothing. However when I run it on my iPhone 4 and it has to have the characters input from the iOS keyboard it behaves much differently. It actually shows the ENTIRE PASSWORD until the user hits the Done button confirming they are finished entering their password where it finally turns them all into the asterisk character I gave it. There's no way I can use it like this as it would potentially reveal many of my user's twitter passwords to onlookers. Any ideas on how to fix this would be INDESCRIBABLY HELPFUL! I'll add my OnGUI() implementation here.
static var twitterUser : String = "";
static var twitterPassword : String = "";
function OnGUI()
{
if (rootView.highRes)
{
GUI.skin = rootView.highResGUISkin;
}
else
{
GUI.skin = rootView.lowResGUISkin;
}
if (selected) // this turns true when the root view calls one of this view's EnterFrom functions
{
startPos = Mathf.Lerp(startPos, endPos, Time.deltaTime * rootView.guiDamp);
GUILayout.BeginArea(Rect(startPos, 0, Screen.width, Screen.height));
GUILayout.BeginVertical();// begin open centering junk
GUILayout.FlexibleSpace();
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();// end open centering junk
GUILayout.BeginVertical("box");
GUILayout.Box("TWITTER ACCOUNT");
GUILayout.BeginHorizontal();
GUILayout.BeginVertical();
GUILayout.Label("USERNAME", "twitterLabel");
GUILayout.Label("PASSWORD", "twitterLabel");
GUILayout.EndVertical();
GUILayout.BeginVertical();
twitterUser = GUILayout.TextField(twitterUser, 15);
twitterPassword = GUILayout.PasswordField(twitterPassword, "*"[0]);
GUILayout.EndVertical();
GUILayout.EndHorizontal();
GUILayout.EndVertical();
GUILayout.FlexibleSpace();// begin close centering junk
GUILayout.EndHorizontal();
GUILayout.FlexibleSpace();
GUILayout.EndVertical();// end close centering junk
GUILayout.EndArea();
}
}
Filed a bug report. Hopefully they can find a fix for me soon so I don't end up using a hack work around.
– franktinsleyBug is confirmed and with a developer for fixing. (June 29th 2011)
– Graham-Dunnett