- Home /
GUI.Label positioning for many device resolutions
Hi, I'm very new to Unity. I bought source code of 2d game where ui interface is hardcoded in this way: GUI.Label (Rect (190,2,40,40), "", "blankchip");
I want to make ui to look good on different devices. For example, I want ui element to be in top right corner of the screen. How can I do it? Thanks
you'll need to do one of the following:
1) convert the ui calls to something like the new ui system in unity 4.6 or buy some other ui system like ngui - it's what some of the cool kids are using ;) there are tutorials and lot of people here to help if you try it yourself first.
2) contact the author of the code that you purchased and ask whether they are going to update it (if they haven't already)
in the long run, 1) will be better for you - it'll be a good learning experience and allow you to get to know unity.
if you have unity 4.6 then look at the learn section - it'll get you started.
please, in future, when you post code, use the code tags (highlight the code section and click on the 101/010 button)
Answer by thef1chesser · Jan 28, 2015 at 11:45 AM
There are the ways mentioned by gjf where lokking in unity 4.6 UI system would be very interesting.
There is a 3rd way. Convert it to a percentile and let it calculate where it should be on the x and y screen coordinates using the used screen resolution.
Thanks, could you please give me a start point of how to "convert it to a percentile".
Your answer
Follow this Question
Related Questions
GUI, making main page lead into an instructions page 2 Answers
Creating a component from a button click 1 Answer
GuiMatrix ? 1 Answer
4.6 UI callback variable 1 Answer