- Home /
Scaling GUI?
Looking through the various ways of implementing a GUI and the troubles of making it work for any screen resolution, it seems that the only way to make a GUI that fits every screen resolution is to use a GUI Matrix, which causes stretching, which I'd like to avoid.
Are there any other better ways of creating a GUI without the old GUI textures? I was thinking of creating a GUI for a single Aspect Ratio, and all others would have either black borders horizontally or vertically on the sides. Is there any way of achieving this?
Note: This is for a main menu, not an in-game GUI.
Answer by Unity Ninja · Aug 08, 2014 at 03:56 AM
What's your question, scaling GUI without GUI Matrix? You can do that by using Screen.Width/Height values for creating those GUIs. Then it works for every resolution.
And about using a different aspect ratio for your menu, check this out http://docs.unity3d.com/ScriptReference/Camera-aspect.html
Scaling without stretching is the main question, so GUI $$anonymous$$atrix is out. If I made the GUI to one aspect ratio, would I have to disable every other ratio?
You don't really need to make GUI for one aspect ratio if u just want a solution for scaling GUI without stretching. But if u want to do it anyway then u use http://docs.unity3d.com/ScriptReference/Camera-aspect.html That aspect ratio will stay as long as you don't reset it.
Answer by falconsoft · Aug 08, 2014 at 03:28 AM
i am not sure but i assume if it were for a menu in 2d you may need 2 separate mode variables to check what scene your in, and then if it is the menu turn off 3d and if it is not turn on 3d. but something tells me it wont be that easy.
Your answer
Follow this Question
Related Questions
GUI Aspect Ratio? 1 Answer
Impossible to design full screen GUI for all aspect ratios? 2 Answers
Can I configure a Rect Transform to preserve its aspect ratio while stretching? 1 Answer
Changing two different objects renderer colour 1 Answer
Aspect Ratio ( supporting different screen resolutions ) 1 Answer