Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: LightSky on October 21, 2013, 12:38:38 PM

Title: UILabel Set Width and Shrink to Fit
Post by: LightSky on October 21, 2013, 12:38:38 PM
Did the ability to set the max width and enabling Shrink to Fit get removed or am I just not seeing it?   
I am talking about having it so when you input more than the max width so it shrinks the content to compensate.
If it is indeed removed, is there any specific reason? It was an incredibly useful option  :-\
Example settings of 2.7 vs 3.0
 (http://i.imgur.com/NjHdtvg.png)
Title: Re: UILabel Set Width and Shrink to Fit
Post by: ArenMook on October 21, 2013, 01:25:20 PM
Dimensions contain both width and height.
Title: Re: UILabel Set Width and Shrink to Fit
Post by: LightSky on October 21, 2013, 01:42:25 PM
Dimensions contain both width and height.

I have the width/height set to the size of the Label that I want it to fit to but the input is being cut off instead of shrinking to fit the Label dimensions. 

Edit:  I am trying to make it shrink to one line.   (Max Line: 1)
Title: Re: UILabel Set Width and Shrink to Fit
Post by: ArenMook on October 21, 2013, 01:44:08 PM
Input as in UIInput? If so, then yes, input forces the label to be clamped in 3.0.2.

Otherwise, max lines setting being non-zero is what would make shrink content stop working in labels.
Title: Re: UILabel Set Width and Shrink to Fit
Post by: LightSky on October 21, 2013, 01:47:57 PM
Input as in UIInput? If so, then yes, input forces the label to be clamped in 3.0.2.

Otherwise, max lines setting being non-zero is what would make shrink content stop working in labels.
(By input I meant the string inside the label)
To clarify, at moment NGUI doesn't have a preset function to shrink the content of a Label to 1 line?
Title: Re: UILabel Set Width and Shrink to Fit
Post by: ArenMook on October 21, 2013, 01:50:18 PM
It does, if you reduce the height down to a height of 1 line. Forget the "max lines" property.
Title: Re: UILabel Set Width and Shrink to Fit
Post by: LightSky on October 21, 2013, 02:21:49 PM
Settings the height only shrinks it to one line for a short time. As seen in my very artistic mock-up
Any advice?  I am probably missing something obvious  ???
The NGUI ~2.7 inspector I showed in my first post replicated this perfectly.

(http://i.imgur.com/qaL5T9G.png)
Title: Re: UILabel Set Width and Shrink to Fit
Post by: ArenMook on October 21, 2013, 04:55:31 PM
Yeah, short version? You can't do what you're trying to do until I change the logic a bit. So either ignore it for now and move on to the next task assuming it will be possible in a future version, or hack it yourself.
Title: Re: UILabel Set Width and Shrink to Fit
Post by: Magic Frame on October 22, 2013, 01:57:33 AM
I have the same problem, Shrink to fit, has disappeared? I do not understand, it was a very important function for me, I have Ngui Pro 3.0.2 and can not find a way to scale text automatically ...
Title: Re: UILabel Set Width and Shrink to Fit
Post by: Magic Frame on October 23, 2013, 03:36:56 AM
Bump!

I need this función, any help?

best regards
Title: Re: UILabel Set Width and Shrink to Fit
Post by: ArenMook on October 23, 2013, 10:03:30 PM
Huh? Shrink option is still there. Check the Overflow handling.
Title: Re: UILabel Set Width and Shrink to Fit
Post by: Magic Frame on October 24, 2013, 02:05:42 AM
Yes, I have selected Shrink content, but does not adjust the text size automatically ...
Title: Re: UILabel Set Width and Shrink to Fit
Post by: Magic Frame on October 24, 2013, 05:35:16 AM
Ok I solved my problem,  the problem is that when you touch the input to add text, Maxline automatically switches to 1, I went to class UIInput and in line 229 change label.maxLineCount = 0, and now works perfect. regards
Title: Re: UILabel Set Width and Shrink to Fit
Post by: ArenMook on October 25, 2013, 12:15:53 AM
Ah, that has already been fixed in 3.0.3.
Title: Re: UILabel Set Width and Shrink to Fit
Post by: Magic Frame on October 25, 2013, 02:56:28 AM
great!