GUILayout.TextFieldstatic function TextField (text : String, params options : GUILayoutOption[]) : Stringstatic function TextField (text : String, maxLength : int, params options : GUILayoutOption[]) : Stringstatic function TextField (text : String, style : GUIStyle, params options : GUILayoutOption[]) : Stringstatic function TextField (text : String, maxLength : int, style : GUIStyle, params options : GUILayoutOption[]) : StringParameters
ReturnsString - the edited string. DescriptionMake a single-line text field where the user can edit a string.
JavaScripts
var stringToEdit : String = "Hello World";
function OnGUI () { // Make a text field that modifies stringToEdit. stringToEdit = GUILayout.TextField (stringToEdit, 25); } using UnityEngine;
using System.Collections; public class example : MonoBehaviour { public string stringToEdit = "Hello World"; void OnGUI() { stringToEdit = GUILayout.TextField(stringToEdit, 25); } } import UnityEngine
import System.Collections class example(MonoBehaviour): public stringToEdit as string = 'Hello World' def OnGUI(): stringToEdit = GUILayout.TextField(stringToEdit, 25) |

