Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Evil-Dog on May 04, 2014, 09:52:24 AM
-
Hi, I'm having problem setting the UI to appear correctly on PC and on the iPad 4. So I tried all combinations of PixelPerfect, FixedSizeOnMobiles and Adjust by DPI but can't get satisfying results. PixelPerfect has the proper anchoring but everything is way too small, which I understand the desired results you'll get on higher resolution, but I want the UI scale to be relative. FixedSizeOnMobiles with my base height of 768 looks better, the scale is right but every elements anchored to the left, right, top and bottom of the UIRoot are off screen.
Maybe I don't understand something basic with this system but can you enlighten me?
Thanks a bunch
-
How are the elements anchored? Fixed size or not fixed size, anchoring should work regardless.
-
Yeah I would think so, on PC it works in all resolutions no problem there. For instance, our top panel is anchored like this
Unified
OnUpdate
UIRoot
Left: Left 0
Right: Right 0
Bottom: Top -40
Top: Top 0
-
That seems fine to me. The sprite will be anchored to the top of the screen and will stretch so it's always from left to right. OnUpdate type updates mean the values get calculated every frame. What is the widget anchored to? Did you try anchoring directly to the camera?
-
Yeah I know what all the anchoring parameters do, it all works fine in different situations on different targets and everything on PC but not on the iPad.
The anchor target is the UIRoot, I can try on the cam. It's all fine in FixedSizeOnMobiles when setting the manual height to 1536, but that makes the interface very tiny. If I set it to 768, which is half, I would think the interface would be scaled by 2, no? How do I get my interface at a higher scale while maintaining the anchors?
-
Seems to work better when anchored to the camera. But there's a margin on all sides. I mean, designing a UI and then scaling it up if you're on a bigger resolution so it's not tiny is a basic need, so what's the standard way to have the same interface on a ipad1 and ipad2-3-4? Like if I have a button as big as my thumb on the ipad 1 and I want the button still the size of my thumb on ipad 2-3-4 :)
-
All I can think of is that you have a part of your UI scaled. That's the only reason things wouldn't line up. Check the scales of objects leading up to your anchored widget. They must all be (1, 1, 1) with the sole exception of UIRoot.
-
The hierarchy was like this
TopicView (gameobject scale 1,1,1, this one had a UIPanel I DON'T KNOW WHY)
Interface (gameobject scale 1,1,1)
UIRoot
HeaderBar (which is the one anchored to the UIRoot as described before)
The problem was the random UIPanel above the UIRoot, works good now! Fixed with a 768 height makes it double sized which is exactly what I wanted.
Thanks for helping me find the culprit! Much appreciated!