EditorGUI.TextArea 文本区域
static function TextArea (position : Rect, text : string, style : GUIStyle = EditorStyles.textField) : string
Parameters参数
- positionRectangle on the screen to use for the text field.
屏幕上用于文本区域的矩形范围 - textThe text to edit. // 编辑文本
- styleOptional GUIStyle. // 可选GUIStyle样式
Returns
string - The text entered by the user.
返回字符串 - 用户输入的文本。
Description描述
Make a text area.
制作一个文本区域。
This works just like GUI.TextArea, but correctly responds to select all, copy, paste etc. in the editor.
这工作就像GUI.TextArea,但是在编辑器中完全正确的响应所有选择,拷贝、粘贴等等
Text Area in an Editor Window.
在编辑器窗口中的文本区域。
// Create a window where you can have notes//创建一个窗口,你可以记笔记// This doesnt preserve the notes between sessions.//在会话间不保存笔记// check EditorPrefs Get/SetString to save the notes.//检查EditorPrefs Get/SetString 来保存笔记class EditorGUITextArea extends EditorWindow {var note : String = "Notes:
->";@MenuItem("Examples/Notes")static function Init() {var window = GetWindow(EditorGUITextArea);window.Show();}function OnGUI() {note = EditorGUI.TextArea(Rect(3,3,position.width - 6, position.height - 35), note);if(GUI.Button(Rect(0, position.height - 30, position.width, 25), "Close"))this.Close();}}