Search Unity

How do I add a scrolling input text box in an EditorWindow?

Discussion in 'Immediate Mode GUI (IMGUI)' started by Ncyphe, Feb 23, 2015.

  1. Ncyphe

    Ncyphe

    Joined:
    Jan 22, 2015
    Posts:
    3
    How do I add a scrolling input text box in an EditorWindow?

    I've been searching for a while, trying to figure out how to making a scrolling text input box for my Unity Addon I'm building. I've had 0 success in finding a solution that works.

    In essence, I need to add a scrolling editable text area to my editorwindow to allow the user to input data, with unknown length, into my extension.

    I've tried the following:
    Code (csharp):
    1.  
    2.                 ScrollPos = EditorGUILayout.BeginScrollView(ScrollPos,GUILayout.Height(100));
    3.                 EditorGUILayout.TextArea(ParseData,GUILayout.Height(200));
    4.                 EditorGUILayout.EndScrollView();
    5.  
    Where ParseData is a string, and ScrollPose is a Vector2.

    This is the structure of the code I've been seeing everywhere; however, it only encases the textarea with a scroll bar, and doesn't add it to the textarea itself. As I add lines to the text area, there is no way to actually scroll the text.

    Am I doing it wrong, is there supposed to be a different way to do this?