static function TextArea (text : string, params options : GUILayoutOption[]) : string
static function TextArea (text : string, maxLength : int, params options : GUILayoutOption[]) : string
static function TextArea (text : string, style : GUIStyle, params options : GUILayoutOption[]) : string
static function TextArea (text : string, maxLength : int, style : GUIStyle, params options : GUILayoutOption[]) : string
string - the edited string.
返回字符串类型,可编辑的字符串。
Description描述
Make a multi-line text field where the user can edit a string.
创建一个多行密码文本区域,用户可以编辑其中字符串。
Text area in the Game View.
在游戏视图中的文本区域。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public string stringToEdit = "Hello World\nI've got 2 lines...";
void OnGUI() {
stringToEdit = GUILayout.TextArea(stringToEdit, 200);
}
}
var stringToEdit : String = "Hello World\nI've got 2 lines...";
function OnGUI () {
// Make a multiline text area that modifies stringToEdit.
//创建一个多行文本区域,修改其中的字符串
stringToEdit = GUILayout.TextArea (stringToEdit, 200);
}