Author Topic: Setting text size for UIPopupList entries in 3.0.5  (Read 3743 times)

DanDeibler

  • Guest
Setting text size for UIPopupList entries in 3.0.5
« on: November 13, 2013, 10:55:41 AM »
For version 3.0.5 (asset store), in the editor, how can we specify the size of the text to be used for the rows of a UIPopupList that uses a BMFont?
For a UILabel, we can simply leave it set to ShrinkContent and change the Y of the Dimensions to the size we need, but I don't see a similar option in UIPopupList. Not seeing a place to specify the size, I had hoped the UIPopupList would use the dimensions specified by its label, but it does not. It appears to just set it to the BMFont's default size. We're pretty stumped over here, and we'd appreciate some help.
« Last Edit: November 13, 2013, 01:49:39 PM by DanDeibler »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Setting text size for UIPopupList entries in 3.0.5
« Reply #1 on: November 13, 2013, 03:23:50 PM »
You can't change the size of a fixed-size font. If you want to be able to change it, use a dynamic font instead.

DanDeibler

  • Guest
Re: Setting text size for UIPopupList entries in 3.0.5
« Reply #2 on: November 13, 2013, 06:32:07 PM »
You can't change the size of a fixed-size font. If you want to be able to change it, use a dynamic font instead.
I'm sorry; I didn't ask the question clearly enough. I'm not asking about changing the size of a font, which is fortunate, because our team is using Unity 3.5.7f6 and NGUI 3.0.5 (asset store) reports in the editor that it only supports dynamic fonts in Unity 4+.
No, my question has to do with the size of the text, something that is easily changeable in a simple UILabel by adjusting the dimensions. We're unable to identify what needs to be set on a UIPopupList to control the size of its rows in the same manner.

Here's one example of a UIPopupList on which we need to control the size of the text. The primary label for the list reduces size properly as it should. The rows of text in the drop-down do not.

There is only one font being used in that screenshot (default size: 32). The UIPopupList doesn't seem to provide an obvious way to control the size of the text in the rows, the way the UILabel does. This worked fine in older versions of NGUI, as they exposed a "Text Scale" (again, we aren't talking about font size here, but rather text size) property on the UIPopupList for this very purpose. Of course, using an outdated version of NGUI is out of the question since it was NGUI's performance problems prior to version 3 that had been preventing us from deploying for quite a while.

We were quite relieved to see that those issues had been fixed in the latest versions.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Setting text size for UIPopupList entries in 3.0.5
« Reply #3 on: November 13, 2013, 08:03:42 PM »
You have to specify a different (bigger) font in the UIPopupList's Font section. Popup list uses this font to create your labels.

DanDeibler

  • Guest
Re: Setting text size for UIPopupList entries in 3.0.5
« Reply #4 on: November 14, 2013, 11:04:51 AM »
You have to specify a different (bigger) font in the UIPopupList's Font section. Popup list uses this font to create your labels.
I'm sorry; I find it difficult to believe that adding a second font to our project, giving it a larger default size, and directing the UIPopupList to use it, will give us additional options on UIPopupList.. Or is this supposed to somehow cause some sort of fallback behavior in the UIPopupList which will make it adopt the text size we specified in the UIPopupList's child UILabel?
I'm finding it more likely that either I am not understanding your answer or you are not understanding our question.. If I had to guess, based on your response, I'd guess that you thought we were trying to achieve the result in the screenshot rather than correct it.
For reference, here is a screenshot of that same UIPopupList, but under NGUI 2. Disregard the gray blocks I've added; as it's an old screenshot, I was not able to remove sensitive information beforehand.

Note that in the old version of NGUI, shown here, we were able to keep the text size of the UIPopupList's rows the same as the text size of the UILabel very easily, by setting textScale to the appropriate ratio. One of our developers who has looked at the code for the new UIPopupList says that, at first glance, it would seem that it be fully capable of drawing the entries at any desired size, but that it simply no longer exposes this functionality and is instead forcing it to use a ratio of 1 for whatever reason. Of course, he does not have a full understanding of how NGUI works in every aspect of what it does, like you do, so he could very easily be misinterpreting the implementation code. I only mention it in order to help communicate the issue we're trying to resolve. Are we able to keep the rows of a UIPopupList drawn to the same size as its UILabel (and if so, how?), or does NGUI no longer support UIPopupList with Unity 3.5.7?
I appreciate that you are trying to help us to get this resolved.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Setting text size for UIPopupList entries in 3.0.5
« Reply #5 on: November 14, 2013, 01:37:21 PM »
You're right, I interpreted it as you wanting the behaviour in the screenshot. You're also right that the functionality is still there, but no longer exposed as it has been deprecated. Font Size is now used instead, but I noticed that I don't seem to provide a way to modify it for fixed size fonts. I will get that fixed for next update, thanks!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Setting text size for UIPopupList entries in 3.0.5
« Reply #6 on: November 14, 2013, 01:49:24 PM »
P.S. Fixed in the latest Pro version.

DanDeibler

  • Guest
Re: Setting text size for UIPopupList entries in 3.0.5
« Reply #7 on: November 14, 2013, 02:09:04 PM »
P.S. Fixed in the latest Pro version.
That's great to hear! Thank you for taking the time to help us with this.
« Last Edit: November 14, 2013, 03:45:50 PM by DanDeibler »