internal override void DrawWindow(int id) { GUILayout.Label(new GUIContent("Window Contents", "Here is a reallly long tooltip to demonstrate the war and peace model of writing too much text in a tooltip\r\n\r\nIt even includes a couple of carriage returns to make stuff fun")); GUILayout.Label(String.Format("Drag Enabled:{0}", DragEnabled.ToString())); GUILayout.Label(String.Format("ClampToScreen:{0}", ClampToScreen.ToString())); GUILayout.Label(String.Format("Tooltips:{0}", TooltipsEnabled.ToString())); if (GUILayout.Button("Toggle Drag")) { DragEnabled = !DragEnabled; } if (GUILayout.Button("Toggle Screen Clamping")) { ClampToScreen = !ClampToScreen; } if (GUILayout.Button(new GUIContent("Toggle Tooltips", "Can you see my Tooltip?"))) { TooltipsEnabled = !TooltipsEnabled; } GUILayout.BeginHorizontal(); GUILayout.Label("Max Tooltip Width"); TooltipMaxWidth = Convert.ToInt32(GUILayout.TextField(TooltipMaxWidth.ToString())); GUILayout.EndHorizontal(); GUILayout.Label("Width of 0 means no limit"); GUILayout.Label("Alt+F11 - shows/hides window"); }
internal override void DrawWindow(int id) { GUILayout.Button("This is a button"); togglevalue = GUILayout.Toggle(togglevalue, "This is a Toggle"); GUILayout.Label("This is a Label"); horizvalue = GUILayout.HorizontalScrollbar(horizvalue, 20, 0, 100); GUILayout.Label("Scrollbar Value=" + horizvalue.ToString("0")); GUILayout.Button("red text button", "RedButton"); GUILayout.Button("Unity button", SkinsLibrary.DefUnitySkin.button); GUILayout.Label("DragEnabled:" + DragEnabled.ToString()); }
protected override void DrawWindow(int id) { /* These items support being passed GUIContent, and thus will support toolips: * (a * beside means we have an example of this tooltip working) * * BeginArea * BeginHorizontal * * BeginVertical * * * Box * Button * * Label * * RepeatButton * * SelectionGrid (has GUIContent[], actually) * * Toggle * * Toolbar (has GUIContent[]) * * Window * * This means that some things will not ever have tooltips: * * BeginScrollView * HorizontalScrollbar * HorizontalSlider * VerticalScrollbar * VerticalSlider * Passwordfield * TextArea * TextField * */ // TODO: 1 GUILayout.Button(textWithTT("This is a button", "the first button in this window.")); // TODO: 2 togglevalue = GUILayout.Toggle(togglevalue, textWithTT("This is a Toggle", "this is the second (but first toggle) button in this window")); // TODO: 3 GUILayout.Label(textWithTT("This is a Label", "With a secondary label!")); pos = GUILayout.BeginScrollView(pos, GoS(), GoE()); text = GUILayout.TextArea(text, GoS(), GoE()); GUILayout.EndScrollView(); // TODO: 4 growE(textWithTT("", "horizontal section"), "box"); growS(textWithTT("", "these two sliders are uncoupled"), "box"); // TODO: 5 horizvalue = GUILayout.HorizontalScrollbar(horizvalue, 0, 0, 100); // TODO: 6 hslider = GUILayout.HorizontalSlider(hslider, 0, 100); stopE(); growE(textWithTT("", "these two sliders are coupled"), "box"); // TODO: 7 pairedhslider = GUILayout.HorizontalScrollbar(pairedhslider, 0, 0, 100); pairedhslider = GUILayout.HorizontalSlider(pairedhslider, 0, 100); stopS(); growE(); growE(); // TODO: 8 vertvalue = GUILayout.VerticalScrollbar(vertvalue, 0, 0, 100); vslider = GUILayout.VerticalSlider(vslider, 0, 100); stopE(); stopS(); stopE(); // TODO: 9 GUILayout.Label("HScrollbar Value=" + horizvalue.ToString("0")); GUILayout.Label("HSlider Value=" + hslider.ToString("0")); GUILayout.Label("VScrollbar Value=" + vertvalue.ToString("0")); GUILayout.Label("VSlider Value=" + vslider.ToString("0")); // TODO: 10 var repeat = GUILayout.RepeatButton(textWithTT("hold me down", "this will be true as long as the button is held")); GUILayout.Label("RepeatButton Value =" + repeat.ToString()); // TODO: 11 var toolbarEntries = new string[] { "first", "second", "third" }; var toolbarWithTT = new GUIContent[] { textWithTT("first", "the first button"), textWithTT("second", "the second button"), textWithTT("third", "the third button") }; // TODO: 12 toolbarA = GUILayout.Toolbar(toolbarA, toolbarEntries); toolbarB = GUILayout.Toolbar(toolbarB, toolbarWithTT); GUILayout.Label("ToolbarA selection:" + toolbarA.ToString()); GUILayout.Label("ToolbarB selection:" + toolbarB.ToString()); // TODO: 13 //selectedBody = GUILayout.SelectionGrid (selectedBody, bodyNames.ToArray (),5); //GUILayout.Label ("Selected Body: " + bodyNames[selectedBody].ToString ()); selectedBody2 = GUILayout.SelectionGrid(selectedBody2, bodyNameDesc.ToArray(), 5); GUILayout.Label("Selected Body: " + bodyNameDesc [selectedBody2].text.ToString()); // TODO: 14 pw = GUILayout.PasswordField(pw, '*'); GUILayout.Label("Password Value=" + pw); // TODO: 15 GUILayout.Button(textWithTT("red text button", "this button is red no matter what skin"), "RedButton"); GUILayout.Button(textWithTT("Unity button", "this button is Unity skinned no matter what"), SkinsLibrary.DefUnitySkin.button); // TODO: 16 GUILayout.Label("DragEnabled:" + DragEnabled.ToString()); }