Unity GUI *Found solution*

A place for tutorials on how to get the most out of Flash

Unity GUI *Found solution*

Postby BlueLight » Fri Mar 28, 2014 12:18 pm

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 ();
User avatar
BlueLight
Gangs n' Whores Developer
 
Joined: Sat Jun 04, 2011 8:23 am

Re: Unity GUI *Found solution*

Postby BlueLight » Fri Mar 28, 2014 12:44 pm

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();

User avatar
BlueLight
Gangs n' Whores Developer
 
Joined: Sat Jun 04, 2011 8:23 am

Re: Unity GUI *Found solution*

Postby inkhryptedQuery » Sat Aug 02, 2014 10:37 pm

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
inkhryptedQuery
 
Joined: Thu Jul 24, 2014 8:21 pm

Re: Unity GUI *Found solution*

Postby BlueLight » Sun Aug 03, 2014 8:30 pm

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.
User avatar
BlueLight
Gangs n' Whores Developer
 
Joined: Sat Jun 04, 2011 8:23 am

Re: Unity GUI *Found solution*

Postby inkhryptedQuery » Mon Aug 04, 2014 7:40 am

Haha, the same exact thing happens to me sometimes. Three months in project time is like centuries of iterations XD
inkhryptedQuery
 
Joined: Thu Jul 24, 2014 8:21 pm


Return to Tutorials



Who is online

Users browsing this forum: No registered users