Centering GUI Buttons so they align neatly.....

I am using just GUILayout.Button for my buttons. This scales the buttons when the window resizes as I want, but they are not centred in neat colums like I want, their size seems to be based on the length of the text in them.

i.e

EditorGUILayout.BeginVertical();
if (GUILayout.Button(“Move To View”))
{
EditorApplication.ExecuteMenuItem(“GameObject/Move To View”);
}
EditorGUILayout.EndVertical();

I have tried using a fixed, numerical width amount at the end of each, but then the buttons don’t scale with the window, they tend to dissapear when the window is made smaller.

I have also tried using screen width /2 , or screen width /3.

I.e
EditorGUILayout.BeginHorizontal();

// Align the camera view to the current objects BUTTON:
EditorGUILayout.BeginVertical();

if (GUILayout.Button(new GUIContent(“View Matches Object”, “The editors view position is matched to the selected objects.”), GUILayout.Width(Screen.width / 2)))
Application.OpenURL(Routines.donationURL);
EditorGUILayout.EndVertical();

// Create Camera from current editor view BUTTON:
EditorGUILayout.BeginVertical();
if (GUILayout.Button(new GUIContent(“Object Matches View”, “Selected objects position is matched to the editors view.”), GUILayout.Width(Screen.width / 2)))

Application.OpenURL(Routines.donationURL);
EditorGUILayout.EndVertical();
EditorGUILayout.EndHorizontal();

Which makes them even out nicely AND scale with the window, but the far right edge is always off screen with these, and doesn’t have the small gap at the farmost side, like it does at the nearmost side.

Any fix for this?

Thanks
Chris

Why not just use GUI instead of GUILayout? Then in it set your Rect to use Screen.width/2 and Screen.height/2.