Search Unity

I can't view BeginScrollView

Discussion in 'Immediate Mode GUI (IMGUI)' started by The_Code, Dec 17, 2013.

  1. The_Code

    The_Code

    Joined:
    Jan 9, 2013
    Posts:
    37
    Hi!! Recently, i view this page in the docs and i adapt my code to the script. Well, i have this code in OnGUI() function:

    Code (csharp):
    1. var registry = PlayerPrefs.GetString("registry");
    2.        
    3.         // The variable to control where the scrollview 'looks' into its child elements.
    4.         var scrollPosition : Vector2;
    5.         scrollPosition = GUILayout.BeginScrollView (
    6.         scrollPosition, GUILayout.Width (Screen.width-100), GUILayout.Height (Screen.height-100));
    7.         GUILayout.Label (registry);
    8.         GUILayout.EndScrollView ();
    The problem is: The scrollers and box not appearing, obviously, the code of the docs is viewed but my code no xD, the GUI not appearing... why? Thanks, i'm new in this typeof GUI, and i can't understand this :p