- Home /
Wondering About Multi-Platform with Multiple Screen Resolutions
Hello, I was having a problem with my GUI labels displaying in-correctly. The labels display fine in the game tab in the unity editor(default layout). However when playing on fullscreen 1920x1080 the labels were all positioned wrong. Will setting the supported resolutions to only 16:9 fix the problem? Also if you know of any good articles on getting started in multi-platform development please let me know.
The code I was using is below. GUI.Label(new Rect(70,20,100,50), "Score: " + PlayersCurrentScore, GUICustom); Thanks, Matthias
Answer by MakeCodeNow · May 24, 2014 at 11:54 PM
Specifying absolute pixel coordinates is the least flexible thing you can do. It will only work at the exact same aspect ratio and resolution. If you want code that works at any resolution at a fixed aspect ratio, then you need to think in terms of normalized screen coordinates (i.e 0...1 scaled by the current screen width or height). If you want to be aspect and resolution independent, then there is no simple answer that "just works" but you can find a lot of other approaches by searching here on on Google.
Thanks for the information. I am fairly new to unity only been using off and on for about two years and just was wondering if there was a easier way of doing this.
Your answer
Follow this Question
Related Questions
Weird Scene View 'Glitching' 0 Answers
Render just one object 1 Answer
Render Two texture IOS not using Blend 1 Answer