- Home /
Positioning a button at the bottom of an editor window
Hey,
I have created an editor window, and let's say I have the following button:
if(GUILayout.Button("Button"))
{
Application.OpenURL("http://unity3d.com/");
}
How can I make it so the that button is always positioned at the bottom of the editor window?
Thanks,
Alex
Answer by rus89 · Jan 22, 2018 at 11:55 AM
Hello @alexanderameye, you simply have to add GUILayout.FlexibleSpace();
before the button. In your example it should look like this:
GUILayout.FlexibleSpace();
if(GUILayout.Button("Button"))
{
Application.OpenURL("http://unity3d.com/");
}
I hope this will help you.
Your answer
Follow this Question
Related Questions
Custom Editor - Is there any way to detect whether the user is in Prefab editing mode? 1 Answer
Drag a non standard unity asset on a custom editor slot 1 Answer
Is it possible to store and display EditorGUILayout.Toggles? 0 Answers
EditorWindow: Use toggle to disable/enable other controls? 1 Answer
Text in custom editor is displayed/rendered with boxes around characters... 2 Answers