Need help creating a scrollable text area for displaying EULA.

I’ve searched the forum but found no solution for this.

I’m trying to create a simple box / text area to show End User License Agreement (or any long text for that matter. eg. a Help/Tutorial page).

I tried using GUI.BeginScrollView along with textArea. The problem is user can’t scroll to the end of the text if the EULA is too long.

Is there some kind of text area that auto-expand itself based on how long the text is?

Thanks in advance!

nvm, I’ve answered my won question with the following code:

var veryLongString = "insert very long text here";
var scrollPosition : Vector2 = Vector2.zero;

    scrollPosition = GUILayout.BeginScrollView(scrollPosition, GUILayout.MaxHeight(300), GUILayout.ExpandHeight (false));
    GUILayout.Label (veryLongString, GUILayout.ExpandHeight (true));
    GUILayout.EndScrollView();

This will create an area with 300 height. Scroll bar will appear if the text is too long.