void OnGUI() { GUI.skin = skin; GUI.BeginGroup(new Rect(50, Screen.height / 2 - 100, 200, 200)); if (GUI.Button(new Rect(0, 0, 200, 40), "Play")) { Application.LoadLevel("Game"); } if (GUI.Button(new Rect(0, 50, 200, 40), "Instructions")) { InstructionsGUI help = gameObject.AddComponent <InstructionsGUI>(); help.skin = gameSkin; help.activateOnQuit = this; enabled = false; } if (GUI.Button(new Rect(0, 100, 200, 40), "Help")) { HelpGUI help = gameObject.AddComponent <HelpGUI>(); help.skin = skin; help.gameSkin = gameSkin; help.bulbSkin = bulbSkin; help.activateOnQuit = this; help.bulbOn = bulb; enabled = false; } if (Application.platform == RuntimePlatform.LinuxPlayer || Application.platform == RuntimePlatform.WindowsPlayer) { if (GUI.Button(new Rect(0, 150, 200, 40), "Quit")) { Application.Quit(); } } GUI.EndGroup(); GUI.DrawTexture(new Rect(Screen.width * 0.5f, Screen.height * 0.25f, Screen.height * bulb.width * 0.5f / bulb.height, Screen.height * 0.5f), bulb); }
private void helpToolStripMenuItem_Click(object sender, EventArgs e) { HelpGUI help = new HelpGUI(); help.StartPosition = FormStartPosition.Manual; help.Location = Location; help.ShowDialog(); }
public override void WindowGUI() { if (worldPaths.Count == 0) { GUILayout.FlexibleSpace(); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); // copied from TemplatePickerGUI GUILayout.BeginVertical(GUI.skin.box, GUILayout.Width(900), GUILayout.Height(480)); GUILayout.Label("Welcome to N-Space\nFollowing the tutorial is recommended!", GUIUtils.LABEL_HORIZ_CENTERED.Value); int selection = GUILayout.SelectionGrid(-1, startOptions, 2, startButtonStyle.Value, GUILayout.ExpandHeight(true)); if (selection == 0) { TutorialGUI.StartTutorial(Tutorials.INTRO_TUTORIAL, null, null, null); HelpGUI.OpenDemoWorld("Tutorial - Introduction", "Templates/indoor"); } else if (selection == 1) { AskNewWorldTemplate(); } GUILayout.EndVertical(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUILayout.FlexibleSpace(); } else { if (GUIUtils.HighlightedButton("New", GUIStyleSet.instance.buttonLarge)) { AskNewWorldTemplate(); } scroll = GUILayout.BeginScrollView(scroll); for (int i = 0; i < worldPaths.Count; i++) { string path = worldPaths[i]; string name = worldNames[i]; bool selected = worldOverflowMenu != null && path == selectedWorldPath; GUILayout.BeginHorizontal(); if (GUIUtils.HighlightedButton(name, GUIStyleSet.instance.buttonLarge, selected)) { OpenWorld(path, Scenes.EDITOR); } if (GUIUtils.HighlightedButton(GUIIconSet.instance.overflow, GUIStyleSet.instance.buttonLarge, selected, GUILayout.ExpandWidth(false))) { CreateWorldOverflowMenu(path); } GUILayout.EndHorizontal(); } GUILayout.EndScrollView(); } }
void OnGUI() { GUI.skin = skin; GUI.color = Color.white; if (isMenuVisible) { GUI.BeginGroup(new Rect(Screen.width - 235, 35, 200, 200)); if (GUI.Button(new Rect(0, 0, 200, 40), "Main Menu")) { Application.LoadLevel(0); } if (GUI.Button(new Rect(0, 50, 200, 40), "Instructions")) { InstructionsGUI help = gameObject.AddComponent <InstructionsGUI>(); help.skin = gameSkin; help.activateOnQuit = this; enabled = false; } if (GUI.Button(new Rect(0, 100, 200, 40), "Help")) { isMenuVisible = false; HelpGUI help = gameObject.AddComponent <HelpGUI>(); help.skin = skin; help.bulbSkin = bulbSkin; help.gameSkin = gameSkin; help.bulbOn = bulbOn; help.activateOnQuit = this; enabled = false; } GUI.EndGroup(); } GUI.skin = bulbSkin; if (GUI.Button(new Rect(Screen.width - 60, 10, 50, 100), isMenuVisible ? bulbOn : bulbOff)) { isMenuVisible = !isMenuVisible; } GUI.skin = gameSkin; if (message != null) { GUI.Window(0, new Rect(Screen.width / 2 - 320, Screen.height / 2 - 240, 640, 480), ShowMessage, ""); } if (notificationTimer > 0) { GUI.color = new Color(1, 1, 1, notificationTimer < 1 ? notificationTimer : 1); GUI.TextField(new Rect(10, 10, 400, 40), notification); } }