Hi, how do i change this script from 2D tutorial to align the GUI on the top right side.
This works beautifully when switching between Fixed Game Dimensions and Free Aspect Full Screen
the gui always stays nicely in the top corner… how do i tweak it to do the same on the right top corner!?
private var windowRect = Rect (20, 20, 250, 50);
function OnGUI () {
// Make a window
windowRect = GUILayout.Window (0, windowRect, DoControlsWindow, “Controls”);
// Align
windowRect.x = Mathf.Clamp (windowRect.x, 0.0, Screen.width - windowRect.width);
windowRect.y = Mathf.Clamp (windowRect.y, 0.0, Screen.height - windowRect.height);
}