How do i make a scroll box with a bunch of buttons inside it? The example on the documentation doesn’t clear up how to put buttons in one. If you dont know what i’m talking about, heres the link. Scroll down the page to see it.
function OnGUI () {
// Begin the ScrollView
scrollViewVector = GUI.BeginScrollView (Rect (25, 25, 100, 100), scrollViewVector, Rect (0, 0, 400, 400));
// End the ScrollView
GUI.EndScrollView();
}
I haven’t been scripting long( about three hours training) but i think that the scripting wiki on this site has a section that explains how to create complex GUIs like scrollbars with text and color controls, stuff like that
@heartfornairobi: yes, there is; it’s a page or so on in the manual from the one TheCowMan linked.
@TheCowMan: look again at the example you referenced; it shows you exactly what to do. The example puts a TextArea inside the ScrollView; to put a button (or several buttons) just use GUI.Button instead of GUI.TextArea. Whatever you draw in between BeginScrollView() and EndScrollView() will be part of (inside) the scroll view.
What if you want to put Game Objects inside the box? How does one do that? I don’t use GUI buttons for memory reasons. But the objects i want inside that can scroll are objects the player can equip. Any ideas? Thanks.