A solution is to set all position to a scale from device size.
For example, instead of set a position to 1366/2, set it to `Screen.width / 2`
If your good at math (basics), you can easily make something work in all resolutions.
Your code should start by:
void OnGUI()
{
GUI.skin = interfaceskin2;
//spacing is the space in pixels on left and right
float spacing = (Screen.width - (4 * 270)) / 2;
GUI.Box(new Rect(spacing, Screen.height - 100 - 20, 270, 100), ""); //20 pixel from bot in this exemple
GUI.Box(new Rect(spacing + 270, Screen.height - 100 - 20, 270, 100), "");
GUI.Box(new Rect(spacing + (270 * 2), Screen.height - 100 - 20, 270, 100), "");
GUI.Box(new Rect(spacing + (270 * 3), Screen.height - 100 - 20, 270, 100), "");
//TODO ...
}
↧