- Home /
using GUI scrollView for multiple onGUI functions
I have multiple GUI scripts that draw various rectangles, labels, etc. and I need them to be separate GUI scripts so I can use GUI depth. With that said, I need them to all be controlled and scrolled using a single scrollView. As of now, I have one static scroll vector that I pass, but still need to use different BeginScrollView functions on each script. This results in it scrolling everything the way I want to, but it also creates multiple scrolls that are in sync but visible.
Any suggestions or functions I don't know about?
Example (obviously not real code):
 //GUIScript1.js
 
 static var scrollPosition : Vector2 = Vector2.zero;
 
 function OnGUI()
 {
     scrollPosition = GUI.BeginScrollView (Rect (0,0,Screen.width,Screen.height),
             scrollPosition, Rect (0, 0, Screen.width*3, Screen.height));
      
     //GUI1 content Here
     GUI.EndScrollView ();
 }
 
 //GUIScript2.js
 
 function OnGUI()
 {
     GUIScript1.scrollPosition = GUI.BeginScrollView (Rect (0,0,Screen.width,Screen.height),
             GUIScript1.scrollPosition, Rect (0, 0, Screen.width*3, Screen.height));
      
     //GUI2 content Here
     GUI.EndScrollView ();
 }
Your answer
 
 
             Follow this Question
Related Questions
Setting Scroll View Width GUILayout 1 Answer
GUI opacity. 1 Answer
turn off items from GUI 0 Answers
GUI Not updating 1 Answer
GUI.Window only shows for one frame under all circumstances 2 Answers
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                