To get started, you can change the resolution, as you said in "Edit"> "Project Settings"> "Player". I think you also know how to change it during development (go to the panel above Game View).
Well, you have to make the game independent of screen resolution. To do this, you can start defining these two variables:
nativeHeightResolution = 1200.0; scaledWidthResolution = nativeHeightResolution / Screen.height * Screen.width
And in the OnGUI () function, you can write this:
GUI.matrix = Matrix4x4.TRS (Vector3(0, 0, 0), Quaternion.identity, Vector3 (Screen.height / nativeHeightResolution, Screen.height / nativeHeightResolution, 1));
Then, if you want to draw a shortcut, for example, you can use this:
function Label_Center(pos : Vector2, text : String, style : GUIStyle) {
This is what I used in my projects. I hope this was helpful to you.
AlexAlmenara Apr 19 '14 at 2:02 p.m. 2014-04-19 14:02
source share