- Home /
Question by
lagidigu3ll · Apr 09, 2016 at 05:34 PM ·
uiscreenrecttransform
Recttransform and Screen Resolution problem
Hello There!
I have had the same problem as esitoinatteso in this thread: http://answers.unity3d.com/questions/976184/ui-recttransform-position-screen-resolution.html,
Where the UI elements appear correctly on the editor, but not on the mobile device. I have tried dividing by the screenScale, as well as multiplying, both doesnt work.
Heres the snippet of my code:
ResumeButton.GetComponent<RectTransform>().position = new Vector3(Screen.width / 2 / screenScale().x, 6 * Screen.height / 10 / screenScale().y, transform.position.z);
QuitButton.GetComponent<RectTransform>().position = new Vector3(Screen.width / 2 / screenScale().x, 4 * Screen.height / 10 / screenScale().y, transform.position.z);
Has anyone encountered something like this and could help me out? Its driving me insane...
Thanks a lot! :D
Comment