Author Topic: [solved]Is there Auto Scale function in UILabel ??  (Read 3129 times)

hmnyari

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 29
    • View Profile
[solved]Is there Auto Scale function in UILabel ??
« on: April 12, 2013, 04:47:43 AM »
watch my screenshot please
I want to decrease the text with the text was to maintain a constant width.
Please let me know how to resolve it.
thank you :)
« Last Edit: April 13, 2013, 10:56:35 AM by Nicki »

dlewis

  • Guest
Re: Is there Auto Scale function in UILabel ??
« Reply #1 on: April 12, 2013, 05:13:28 AM »
This was added in the latest version of NGUI. 'Shrink to fit text', it doesn't scale text up though, just down when it needs to.

hmnyari

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 29
    • View Profile
Re: Is there Auto Scale function in UILabel ??
« Reply #2 on: April 13, 2013, 06:13:56 AM »
thank you dlewis :)

Irin1178

  • Guest
Re: [solved]Is there Auto Scale function in UILabel ??
« Reply #3 on: June 11, 2013, 03:21:41 PM »
Anyone figure out how to get it to scale up when needed?

We have a money amount I'd like to scale back up to its original scale value if it would fit in the max width setting on the UILabel.

Right now, the player could get rich, shrinking the size of the money value to fit in the box. then spend it all and have a very tiny money number.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: [solved]Is there Auto Scale function in UILabel ??
« Reply #4 on: June 11, 2013, 03:24:55 PM »
Call MakePixelPerfect on it after setting the amount.

Irin1178

  • Guest
Re: [solved]Is there Auto Scale function in UILabel ??
« Reply #5 on: June 11, 2013, 03:40:24 PM »
Thanks, easy enough.

I am having trouble getting shrink to fit to work in 2.6.2. it seems to have broken after i merged up. Now it just seems to word wrap all the time even when shrink to fit is turned on.

I've rolled back UILabel's ProcessText back to what was in 2.6.1 and its working locally. I noticed that function was changed pretty drastically in 2.6.2.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: [solved]Is there Auto Scale function in UILabel ??
« Reply #6 on: June 11, 2013, 03:45:31 PM »
Set the max number of lines to 1.

Irin1178

  • Guest
Re: [solved]Is there Auto Scale function in UILabel ??
« Reply #7 on: June 11, 2013, 04:06:31 PM »
i tried this before after reading the code. no luck

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: [solved]Is there Auto Scale function in UILabel ??
« Reply #8 on: June 11, 2013, 04:09:42 PM »
The label will only create more than 1 line with the max lines set to 1 if it's able to fit them in the space afforded by 100% of the label's height. Meaning if your font size is 20, and the max lines is set to 1, you will be able to fit two 10-height labels.