Author Topic: 2.3.1-> 3.x upgrade woes: font size  (Read 2691 times)

AeornFlippout

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 46
    • View Profile
2.3.1-> 3.x upgrade woes: font size
« on: January 20, 2014, 11:12:50 PM »
I've spent the day attempting a 2.3.1 upgrade to the latest 3.0.9f version. I've been reading upgrade notes, various posts here, and watching the upgrade video.

One thing I didn't see mentioned was how to correctly update the various labels.
For us, it seems that virtually every label is scaled up to 3x or so the original size.

It seems there are a variety of posts here from folks having similar issues. Could someone summarize what exactly is going on?

We were using the widget scale to set the individual size of our text, and I understand that the upgrade process changed the scale of all of the label widgets to <1,1,1>. But it doesn't seem like it took the original scale into account when deciding what the width/height dimensions of the upgraded widgets would be.

Am I missing something? Were all of these setup incorrectly before? Is there no way for the upgrade scripts to figure out how to convert one to the other, and do I need to go through my UI and manually fix all of these?

Also - would it have been better to do this upgrade in a multi-step process between versions - and if so, how could I get my hands on an in-between version at this point?

Thanks for any advice!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 2.3.1-> 3.x upgrade woes: font size
« Reply #1 on: January 21, 2014, 12:48:04 AM »
I'm not sure about the difference in label sizes, but I would strongly advise to upgrade to 2.7.0 first, and only then go up to 3.0.9.

AeornFlippout

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 46
    • View Profile
Re: 2.3.1-> 3.x upgrade woes: font size
« Reply #2 on: January 21, 2014, 03:05:20 PM »
I did the upgrade to 2.7 as suggested, and everything seemed more or less fine.

However, I'm seeing the same issue when going to the latest 3.x version.

Here is an example, a dialog with a text label from 2.7.0, using a scaled transform:


And the settings that were used for that selected label:


And here's what the same dialog looks like after the upgrade, with no manual changes:


And here are the new inspector settings:
https://dl.dropboxusercontent.com/u/41564278/nguiIssue/Screen%20Shot%202014-01-21%20at%201.56.05%20PM.png

Here's the font settings for reference as well:


I feel I must be missing something here, as the 2.7 -> 3.0 upgrade process in the video didn't seem to have this issue with any of the labels, and I'm seeing it on all of my labels.

Is there a way I can convert my labels to the new system without manually tinkering with each of them?

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: 2.3.1-> 3.x upgrade woes: font size
« Reply #3 on: January 21, 2014, 06:09:34 PM »
I think you're gonna have a bad time. You have to set the sizes again for everything properly, but instead of scaling it, you should set the font size and MakePixelPerfect() on them.

Alternatively, you can define areas for labels and have the label resize to fit, with KeepCrisp on, then it chooses the closest font size of the final scaling.

AeornFlippout

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 46
    • View Profile
Re: 2.3.1-> 3.x upgrade woes: font size
« Reply #4 on: January 21, 2014, 06:14:03 PM »
Thanks for the reply Nicki.

So, after tinkering a bit, it seems like what NGUI is trying to do is normalize the scale on the widget, and then set the appropriate font size. However, the font size isn't an option for the bitmap font, and so bitmap font labels that used scale are just totally screwed up.

It seems that changing my font to dynamic, and setting the "default font size" to the imported size of my bitmap font, and then attempting to load the 2.7 scene, results in something closer to what I expect. There are still quite a few widgets that are the wrong scale, apparently due to the upgrade process not handling certain cases where objects in the hierarchy were scaled (such as the scale on a root button object.)

If my understanding of this is correct, it'd be great if the 3.x upgrade notes could be updated with something to that effect. And maybe it shouldn't set the scale to <1,1,1> for labels that use bitmap fonts if that's going to result in a bad scale?