Hello all,
I have a login interface that looks great at a particular resolution but tiny when exported to my phone, for example. It looks like this:
I can’t figure out how to automatically scale the UI elements with screen size without writing a bunch of code like this:
sizeX = Screen.width/1.975f;
sizeY = Screen.height/16.87f;
loginData[0].transform.position = new Vector3((Screen.width/4 - 10)*3, (Screen.height/2) + (sizeY + sizeY/2)*2,0.0f);
loginData[0].transform.localScale = new Vector3(sizeX/160.0f, sizeY/30.0f, 1.0f);
loginData[1].transform.position = new Vector3((Screen.width/4 - 10)*3, (Screen.height/2) + (sizeY + sizeY/2),0.0f);
loginData[1].transform.localScale = new Vector3(sizeX/160.0f, sizeY/30.0f, 1.0f);
Is there an easier way to get my elements to scale with screen size instead of remaining absolutely sized? Anchoring to stretch across the screen won’t work because of the text labels next to the input fields; the input fields won’t have an anchor point on the left side nor would the text labels have an anchor point on the right.
Thoughts? Thank you!
