1
NGUI 3 Support / Re: Why isn't the UI Root the same size as the camera
« on: December 09, 2016, 01:58:00 PM »
that seems to be doing the trick so far thanks for the help
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
When you target UIRoot, it just falls through to targeting the camera used to draw the UI. In your case the game view is hidden, and I'm venturing a guess that you're on a mac -- and there is a Unity bug preventing the screen size from being determinable on a retina mac. This is why the purple border is off.
Make sure you're on the latest NGUI. Open NGUITools.cs, go to line 1907 and add [System.NonSerialized] in front of it:
[System.NonSerialized] static Vector2 mGameSize = Vector2.one;
Oh, I see your issue. You're on a Mac using Unity 5.4. OSX version of the Unity editor has a bug in it where the screen size can't be determined unless the game view is actually visible. You need to simply have your game view actually visible, and it will work as expected.
You're adding what anchor? Widgets have built-in anchoring, and it doesn't touch the transform scale. Nothing does. The anchoring changes the Size property of the widget and adjust the transform's position. Select the UIRoot, ALT+SHIFT+P -- this forcefully resets all scales to their default correct values of (1, 1, 1).
When working with NGUI, the same as Unity's UI, you need to be using the Rect transform too (T shortcut). If you're using W (move) and R (scale), then you're using the wrong tools.
To re-iterate on what I said. Transform scale must remain (1, 1, 1). Look at your scale in your own video: 6.21?