I have some buttons within a ScrollView.
And they don’t seem to be able to communicate out of the view.
What I have is
function OnGUI () {
if (GUI.Button(new Rect (0, 0, 100, 20), "1")){
GUI.Label(Rect(150, 0, 200, 20), "You picked IT");
Debug.Log("this buttons name is working");
}
// Begin the ScrollView
scrollViewVector = GUI.BeginScrollView (Rect (200, 100, 200, 100), scrollViewVector, Rect (0, 0, 400, 400), false, true);
// Put something inside the ScrollView
if (GUI.Button(new Rect (0, 0, 100, 20), "1")){
GUI.Label(Rect(400, 100, 400, 20), "You picked #1", listStyle);
Debug.Log("IN BUTTON 1");
}
if (GUI.Button (Rect (0,21,100,20), "2")){
GUI.Label (Rect(200, 70, 200, 20), "You picked #2", listStyle);
Debug.Log("IN BUTTON 2");
}
//GUI.Button (Rect (0,0,100,20), "1");
//GUI.Button (Rect (0,21,100,20), "2");
GUI.Button (Rect (0,41,100,20), "3");
GUI.Button (Rect (0,61,100,20), "4");
GUI.Button (Rect (0,81,100,20), "5");
GUI.Button (Rect (0,101,100,20), "6");
GUI.Button (Rect (0,121,100,20), "7");
GUI.Button (Rect (0,141,100,20), "8");
// End the ScrollView
GUI.EndScrollView();
}
So the first button created is outside the view and works just fine.
But those created inside render and interact but will not communicate.
Thoughts?