- Home /
turn off items from GUI
I have a GUI made up of a large number of buttons, pressing each button calls a function that affects the scene in some way (showing an object, showing images .etc), everything works fine and I can hide the objects when I push the buttons again .etc
what I really need to be able to do is run the hide function when I push a different button (to prevent everything overlapping and killing the performance). I've tried creating a function that calls the 'off' for each button but this caused some problems (everything assumed it was off and nothing worked)
does anyone have any opinions of how I could get this to work?
thanks
heres some example code:
function onGUI () { button showObject (boolean) button showImage (boolean) }
showObject { if (boolean) { do what it is supposed to enable a 2nd script (has more menu controls .etc) } else { hide the object disable the script } }
showImage { same as showObject }
basically, each function enables/disables its contents based on a boolean i send in (i.e true if it is on (so we are disabling it), false if it off (so we are enabling it).
Please include some of your code (format it with the little 1001 button for easy reading) and we'll try to help.
Is this Boo or Javascript or pseudocode? I would not use 'boolean' as a variable name.
javascript/pseudoce. boolean isn't the variable name, just what is being checked.
Your answer
Follow this Question
Related Questions
using GUI scrollView for multiple onGUI functions 0 Answers
GUI opacity. 1 Answer
Setting Scroll View Width GUILayout 1 Answer
GUI Not updating 1 Answer
GUI.Window only shows for one frame under all circumstances 2 Answers