Page 1 of 1

Unity GUI *Found solution*

PostPosted: Fri Mar 28, 2014 12:18 pm
by BlueLight
Okay so i need some help with my GUI. I want to write a method for the delta change in a scroll bar but first i need to collect data. i want to use a GUI component to display my results so i can write the method. So heres the problem, i want to display my results at the 100 pixels on the right side of the screen, but i can't figure out how to do that. here is the code i'm messing with.

Code: Select All Code
/GUI.Box(new Rect(0,0, Screen.width, Screen.height-150),"");
      //scrollPosition = GUILayout.BeginScrollView (scrollPosition, GUILayout.Width (Screen.width-100), GUILayout.Height (Screen.height-150));
      //GUILayout.Label(this.gameText);
      //GUILayout.EndScrollView ();

      debuggingVectorScrollPosition = GUILayout.BeginScrollView(this.debuggingVectorScrollPosition, GUILayout.Width(Screen.width),GUILayout.Height(Screen.height-150), GUILayout.MaxWidth(100));
      GUILayout.Label("TEST LABEL");
      GUILayout.EndScrollView ();

Re: Unity GUI *Found solution*

PostPosted: Fri Mar 28, 2014 12:44 pm
by BlueLight
Found a solution, here's the code used.

Code: Select All Code
      
      scrollPosition = GUILayout.BeginScrollView (scrollPosition, GUILayout.Width (Screen.width-100), GUILayout.Height (Screen.height-150));
         GUILayout.Label(this.gameText);
         //GUILayout.Box("");
      GUILayout.EndScrollView ();
      
      GUILayout.BeginArea(new Rect(Screen.width-100,0, 100, Screen.height-150));
         debuggingVectorScrollPosition = GUILayout.BeginScrollView(this.debuggingVectorScrollPosition, GUILayout.Width(100),GUILayout.Height(Screen.height-150));
            GUILayout.Label("TEST LABEL");
         GUILayout.EndScrollView ();
      GUILayout.EndArea();


Re: Unity GUI *Found solution*

PostPosted: Sat Aug 02, 2014 10:37 pm
by inkhryptedQuery
Thank you for being the developer that finds solutions and posts them up, even when it's your own question.

We've all been to threads where they just say "Never mind I fixed it" and the thread is never touched again

Re: Unity GUI *Found solution*

PostPosted: Sun Aug 03, 2014 8:30 pm
by BlueLight
Oh god..... is it bad if i don't understand my own question?... let me reread that again. maybe i should look at the code.
EDIT
Alright i think i know what game this is question came from and the problem. I just need to look at the code.
EDIT
No it's my current project. IDK why i thought i was my first project since that didn't have scroll bars.

Re: Unity GUI *Found solution*

PostPosted: Mon Aug 04, 2014 7:40 am
by inkhryptedQuery
Haha, the same exact thing happens to me sometimes. Three months in project time is like centuries of iterations XD