- Home /
Question by
frankyboy450 · Oct 08, 2013 at 04:08 PM ·
buttontoolbarback
How to place button inside window same place
Hi. I made a function called "OptionsWindow" Inside this I have a toolbar on the top. if the toolbarInt is 0 it shows the audio settings, if it's 2, it shows the Graphic settings etc. I have a Back button on each "page" but it's on a different position depending on which toolbarInt is chosen. How can I make the Back button stay on the same position all the time?
This is the code I use for the Back button
if(GUILayout.Button("Back", GUILayout.Height(buttonHeight)))
{
Debug.Log("Back");
audio.PlayOneShot(clickSound);
showOptionsWindow = false;
showMainMenuWindow = true;
}
Thanks -Frank
Comment
Best Answer
Answer by PProductions · Oct 08, 2013 at 05:06 PM
You can make a GUI control's position set by using
GUI.Button
rather than GUILayout. Here is the scripting reference for this: Scripting Reference