Hello! I am making a game, and I need to pull up a keyboard, but I don't know how to save the entered text as a string. My code is:
#pragma strict
// Hides the keyboard if the device is facing down
// and resumes input if the device is facing up.
var f = 0;
var s = 10;
private var keyboard : TouchScreenKeyboard;
function Update() {
if (keyboard != null)
{
if (f == 160)
keyboard.active = true;
}
}
function OnGUI() {
if (GUI.Button(Rect(f, s, 200, 32), "Open keyboard"))
keyboard = TouchScreenKeyboard.Open("", TouchScreenKeyboardType.Default, false, false, true, true);;
}
How would I save the entered text as a string? Thanks for the help!
↧