I heve some problems with making UI in Unity3d.
I have a dropdown element with 5 DDN items. This is original structure of DDN.
But on wide screen DDN items not responsive(2736x1824).
This is on FreeAcpect screen.
I want to make an elements responsive, but unity don't make it itself.
I try to set BestFit checkbox of Text element but no results.
I have created a Dropdown with default properties and it is showing responsive behavior for bigger resolutions as well, as expected.
What you might be missing is the UI Scale Mode in Canvas Scaler component.
Also see
Designing UI for Multiple Resolutions.
Related
My UI elements inside my panels are scaling fine with screen size, but the distance between my different panels is not. I have 3 panels in my scene at different relative position which i set at 1920x1080 reference resolution, and switching between them using animation. But when i change the game view resolution, these panels do not align themselves right. Here are the screenshots:
These are the panels at 1920x1080 which i set.
These are the panels when i set game view resolution to 2340x1080. As you can see, the "settings" panel is still fine but the "more settings" panel does not repositioned correctly.
The same thing happens when i set game resolution to 800x480.
Please help me..
The easiest way you can achieve what you are attempting to do is to use a component called GridLayoutGroup. Add this component to a parent object, child all three of your UI elements to it, and set the column count to 2. I can add an example in a bit, currently building a project.
Edit: Here is a gif example of the above solution.
I have a badge animation that has a child of text and then a button that decreases the level that should always appear behind the score badge.
I have tried a lot of things(like sorting layer component but then the badge renders over all UI elements even its child text) but fundamentally I changed the Decrease level and Text to just be Default for the layer option and set the Z position and scale to 0. I have then changed the Score Badge and its child to be layer UI and negative coordinates so they appear in front of the camera but the issue still persists.
Here is the editor hierarchy
The issue I am having is the rendering looks like this:
If you use Layers try dragging it in sorting layers the one in the bottom of the stack will render in front.
I'm trying to show a ui panel using unity3d ,I have a main camera scene after i click a button ,i want my scrollable panel to show up
just like this
after i click the menu button i want the scrolling ui to appear like this.
It'd be great if someone could point out some kind of a tutorial that would cover this.
You need the following:
Image component - This is used to represent the items you want
to display
Grid Layout Group component - This is used to arrange those
image components you want to display.
Content Size Fitter component - This is used to make sure
that those Images fit in the Grid Layout.
The video from here should show you how to use these 3 together to get what you are looking for. To detect which Image is clicked, see this post.
I'm not familiar with Unity's new UI system of 4.6 and later. I would like to display a series of buttons on screen and have them center-aligned and breaks into the next line when screen width is reached. The old OnGUI function no longer seem working so I wonder how can I achieve this?
You need to use UI's layout system. Usually, you just create a Layout Group and populate it with objects that have Layout Element component.
I have created a level editor using new UI system in Unity3D.
Using Level Editor:
I can drag the ui elements,
I am able to save them in scriptable objects
But how could i save and load them at runtime?
I mean, if i create a level with some {width x hight} resolution and if i load it on different resolution, then the whole UI positioning get distorted.
How could i anchor them correctly programmatically?
Any help would be appreciated.
There are good video tutorials about the 4.6.x UI here:
http://unity3d.com/learn/tutorials/modules/beginner/ui.
Especially for positioning the elements I recommend watching: http://unity3d.com/learn/tutorials/modules/beginner/ui/rect-transform.
I suggest you learn how to use the anchor correctly first. If you want to change the position and size of UI element in a script you can do that through the RectTransform component. It offers functions like offsetMax,offsetMin and sizeDelta for position your UI element. The functions you need to use depend on your anchor setting.
as LokiSinclair said. You just need to Adjust the Scale that the new UI provided. It is the four Arrow on the Canvas of each Object and every UI object is inheriting their scale behavior from their Parent.