1 琐凭、textField官網(wǎng)API的描述如下:
Make a single-line text field where the user can edit a string.
制作一個單行文本字段,用戶可以編輯一個字符串浊服。
string text="textField";
void OnGUI ( )
{
//TextField文本輸入框
text=GUI.TextField(new Rect(100,50,100,20),text);
}
2统屈、PasswordField官網(wǎng)API的描述如下:
Make a text field where the user can enter a password.
使用一個文本字段,用戶可以以密碼的形式輸入牙躺。
string password="passwordField";
void OnGUI ( )
{
//PasswordField密文本輸入框
password=GUI.PasswordField(new Rect(100,100,100,20),password,"*"[0]);
GUI.Label(new Rect(100,150,100,20),password);
}
3愁憔、TextArea官網(wǎng)API的描述如下:
Make a Multi-line text area where the user can edit a string.
制作一個多行文本區(qū)域,用戶可以編輯一個字符串孽拷。
public stringtextAre="textArea";
void OnGUI ( )
{
//TextArea文本輸入自動換行
textAre=GUI.TextArea(new Rect(100,200,100,80),textAre);
}