GUI Programming, trying to create a customizable menu component

Hi,

I am new to Unity and its GUI environment. I have been working for some days on my own getting the idea of how it works. I am trying to create a component, sort of a toolbox, where the user would be presented with a set of options in the form buttons upon pressing any button the sub-options attached to that button would be displayed. If any other option is selected then the sub-options attached to it would be displayed and the previous sub-options would be hidden again. The sub-options might contain any control like a button, textfield, label, checkbox etc… Controls will be nested even another toolbox within the sub-option might be present. The problem is how to get the value of the controls make this customizable so that the user can create the whole thing without the need to code using options provided in the inspector window attaching listener or somehow connecting to the code e.g.


Option 1
checkbox
textfield
another sub-toolbox

Option 2
so on…


I hope it’s clear enough or do ask

Thanks,

Could just do something like activating each set of options when the button is pressed… simply using a if and bool to see if that option was selected.

If(GUI.Button(new Rect(10,10,30,10), “Option 1”)
ShowOptionOne = !showOptionOne;

If(showOptionOne)
// show option one

Keeping track of position could be tricky. But you could try to use a class variable that holds the y value of the options and before each options += 50 or whatever size you wish… that way when the option 1was for instance is hit all of the y positions would be properly moved.
just remember on the first element you just need to declare the intial position… y =50; that way you don’t keep incrementing and never see your gui elements.

Sorry for any misspellings and such. Im on my phone.

http://forum.unity3d.com/threads/117241-Unity3d-Tutorial-Creating-a-Main-Menu!-Simple-with-saving!-(New)

I go over how to do pop up screens… It’s teaches you basics like this :slight_smile: