Author Topic: Importing 3.0.8 f4 - Completely changed my UI layout, dimensions  (Read 4137 times)

ddub

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 18
    • View Profile
Hey guys,

I upgraded my project successfully to NGUI 3.0.8 f4 from 2.6.4, however all of my previous UITextures (now UISprites) are far too large, and even some of my basic widgets are resized. Does this have to do with the new Dimensions field in the Inspector?

I didn't follow perfect rules for anchoring in the past, but it worked great prior to this upgrade. My UI Root is still at 1536 fixed size as before.

I'm sure I could just go to a backup of mine and resize all of the UI components again to how they were before, but that'd take a couple hours. Anyone have this issue & find a solution?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Importing 3.0.8 f4 - Completely changed my UI layout, dimensions
« Reply #1 on: January 05, 2014, 05:27:15 PM »
Check the pixel size on your atlas. It would be the only thing that would affect the size of widgets. Otherwise a 300x200 pixel widget should be exactly 300x200 pixels on the screen.

P.S. Depending which version you were upgrading from, padding may be handled differently. The current version respects it, some earlier versions didn't always respect it.

ddub

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 18
    • View Profile
Re: Importing 3.0.8 f4 - Completely changed my UI layout, dimensions
« Reply #2 on: January 05, 2014, 11:57:54 PM »
Super quick reply - thanks man.

For some of the UITextures (which were large, and existed outside of any atlas to decrease memory issues at runtime), I changed the scale of those objects in the scene, respecting the aspect ratio, as they were larger than needed when I imported them. I was going to resize them outside of Unity, but with the prior version of NGUI, I had no apparent quality issue with simply changing the scale of the object.

That may contribute to the issue (?) but they appear way bigger than even the pixel size of the widgets with 3.0.8. i.e. a 37x256 UITexture appeared to be 5x+ longer than my 1536x2048 uiroot panel.


Do sprites default to pixel perfect size now, even if they were previously scaled to not be pixel perfect? Some of my basic widgets/textures were not pixel perfect, and those are the ones that seem to be problematic. If that's the problem, do you know how I could work around that?


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Importing 3.0.8 f4 - Completely changed my UI layout, dimensions
« Reply #3 on: January 06, 2014, 10:25:50 AM »
Upgrade process from NGUI 2 to NGUI 3 resets the scale to (1, 1, 1) because in NGUI 2 you used to modify scale to set width and height, while now you modify actual width and height values on widgets.