GUI.TextArea 文本区域

static function TextArea (position : Rect, text : String) : String
static function TextArea (position : Rect, text : String, maxLength : int) : String
static function TextArea (position : Rect, text : String, style : GUIStyle) : String
static function TextArea (position : Rect, text : String, maxLength : int, style : GUIStyle) : String

Parameters参数

Returns 返回

string - the edited password.
返回被编辑的密码。

Description描述

Make a Multi-line text area where the user can edit a string.

创建多行文本区域,用户可以编辑字符串。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public string stringToEdit = "Hello World\nI've got 2 lines...";
	void OnGUI() {
		stringToEdit = GUI.TextArea(new Rect(10, 10, 200, 100), stringToEdit, 200);
	}
}
var stringToEdit : String = "Hello World\nI've got 2 lines...";

function OnGUI () {
	//创建多行文本区域,可以修改编辑字符串
	stringToEdit = GUI.TextArea(Rect (10, 10, 200, 100), stringToEdit, 200);
}
Page last updated: 2011-1-14