Quantcast
Channel: Answers by "VincentDB"
Viewing all articles
Browse latest Browse all 12

Answer by VincentDB

$
0
0
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 ... }

Viewing all articles
Browse latest Browse all 12

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>