- Home /
Can I resize UI elements together uniformly?
I've been designing a UI in the new 4.6 system and then added the new Canvas Scaler component, set it to Scale with Screen Size, and set a Reference Resolution. They now scale in accordance with different screen sizes.
However, after setting the Reference Resolution it changed the sizing of all my elements. I want to resize all the UI elements I've carefully positioned and sized relative to each other — Is it possible to resize them all at once without having to do it one item at a time? If I try and resize the parent panel that contains all the elements, they don't resize uniformly and change in weird and unexpected ways.
TLDR: So, even though the canvas scales correctly now, resizing in scene view doesn't.
When i try and scale using the UI system but it doesn't scale or resize
Are you asking for a way to select multiple UI items and do something like decrease their width by half?
It was explored a bit here: http://forum.unity3d.com/threads/how-to-resize-a-ui-properly.280660/ No definitive answer was given though.
in thr tutorial he says if you change the screen resolution the canvas should automatically resize in screen space overlay, it doesn't???????
Answer by Vurawid · Dec 05, 2014 at 08:02 AM
I downloaded the test project from the forum post mentioned: How to resize a UI properly
Made some changes and attached a modified version: UI Resize Test
Unzip, open new or existing project, then import custom package in order to check out the test scenes. Does either one do what you want?
In order to get UI objects to scale in a more expected way, the anchors need to be positioned properly. Frequently this means positioning the anchors to the corners of the object. One way to manually set anchors to the corners is to move them then set left, top, right, and bottom values to 0.
There is a previous answer with some useful code I have used that provides a menu option to snap the anchors to the corners: Anchor snap to button
Vurawid, I tried downloading your modified version but there's no unity package file in the zip. I get 3 folders, each with "asset" "metaData" and "pathname" files.
Unsure why that's happening with the zip file. Downloaded it and looks fine on $$anonymous$$ac and Windows for me so I attached it to the forum post as unitypackage since that's allowed there.
That unitypackage worked it out. Simply an anchors issue.
If anyone is having this issue, please see both this Answer and the forum post linked at the top of Vurawid's answer.
$$anonymous$$any thanks for the help!
Your answer

Follow this Question
Related Questions
Animation not playing on game object activated by script 3 Answers
Unity 4.6 UI Canvas width & height 2 Answers
Custom Dropdown Sorting Order problem 2 Answers
m_TransformInfo.localAABB.IsValid() 0 Answers
pop up a canvas when the time is up 1 Answer