How I can resize the window Unity, and reposition the GUI, because when I change the resolution of my screen GUI are some over others, as I leave is not in the default window, I can do?
I’m position by the x and y property of the transform in the Property inspector, may be happening.
If I understand correctly, you are asking about stand-alone players changing size because you change screen resolution? You could keep track of ‘lastScreenSize’ in an Update loop to look for changes, then resize your windows when you detect a change. If you use GUILayout it might look like this:
var lastScreenWidth = 0;
var lastScreenHeight = 0;
var windowRect : Rect;
function Start()
{
lastScreenWidth = Screen.width;
lastScreenHeight = Screen.height;
windowRect = new Rect (10, 10, 10, 10);
}
function Update()
{
if (lastScreenWidth != Screen.width || lastScreenHeight != Screen.height)
windowRect = new Rect (10, 10, 10, 10); // will force a rearrangement of the window
lastScreenWidth = Screen.width;
lastScreenHeight = Screen.height;
}
OnGUI()
{
windowRect = GUILayout (1, windowRect, ...
Although you could put that stuff from Update into OnGUI too I suppose.