Is it possible to have more than one gui window visible at the same time? if so how?
Using UnityGUI? Of course!
// This is public so that you can add new windows from the inspector.
public Rect[] windowPositions;
void OnGUI()
{
// Loop through all of the window positions
for (int i = 0; i < windowPositions.Length; i++)
// and draw a window at the current position.
windowPositions[i] = GUI.Window(GUIUtility.GetControlID(FocusType.Passive), windowPositions[i], OnWindowGUI, "Window " + i);
}
void OnWindowGUI(int id)
{
// Draw window controls here.
// Allow the window to be dragged. We make the
// draggable area so wide because we don't know
// how wide the window will be.
GUI.DragWindow(new Rect(0, 0, 10000, 20));
}
Of course, you can also use different methods for different kinds of windows.
void OnGUI()
{
inventoryWindowPosition = GUI.Window(GUIUtility.GetControlID(FocusType.Passive), inventoryWindowPosition, OnInventoryGUI, "Inventory");
statusWindowPosition = GUI.Window(GUIUtility.GetControlID(FocusType.Passive), statusWindowPosition, OnStatusGUI, "Stats");
questWindowPosition = GUI.Window(GUIUtility.GetControlID(FocusType.Passive), questWindowPosition, OnQuestGUI, "Quests");
}
void OnInventoryGUI(int id) {}
void OnStatusGUI(int id) {}
void OnQuestGUI(int id) {}
I couldint realy figure it out but I just want to display 2 GUI windows at the same time.