Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Samhayne on October 16, 2014, 08:46:44 AM

Title: Minimum Height for a Label?
Post by: Samhayne on October 16, 2014, 08:46:44 AM
Hey,

is there a sane way to assert a certain minimum height of a widget?

I saw that there is a minHeight value in the widget class, though it has nor setter
and we don't want to edit the NGUI sources.

What I want to achieve:

A textbox like this which dynamically enlarges the window...

(http://s14.directupload.net/images/141016/t8ic7ivm.png)

... but...

If it's just one line of text I don't want everything to collapse to one
line (using Overflow: ResizeHeight) as it looks weird....

(http://s14.directupload.net/images/141016/cvcfor3m.png)

... instead I'd like a minimum height to be preserved.

(http://s14.directupload.net/images/141016/nilfapy4.png)



At the moment the window borders are anchored to the text label.


Already thought about some dummy padding widget which would adapt its
height to a needed value by constantly measuring the height of the text
field but....  *blearch* ... this would be a dead ugly solution.
Title: Re: Minimum Height for a Label?
Post by: ArenMook on October 17, 2014, 04:46:53 AM
TypewriterEffect already handles this. Check the "Keep Full Dimensions" checkbox.
Title: Re: Minimum Height for a Label?
Post by: Samhayne on October 20, 2014, 08:36:13 AM
Hi ArenMook,

Hm... I tried this script but my text ...

1
2
3
4
5

turned into

1
2
3
4
[00]5

then. With the 5 not being shown any more.

I missed to point out that the label should still show all the content and resize.
I just want it to keep a minimum height.


edit: I helped myself now by modifying your "EnvelopContent" script you posted here:
http://www.tasharen.com/forum/index.php?topic=8659.0
Title: Re: Minimum Height for a Label?
Post by: ArenMook on October 20, 2014, 11:37:29 PM
The typewriter effect script has a minor bug in it in the current Asset Store version that's fixed in the Pro version where it doesn't show the last character. There was a thread on it maybe two days ago where I posted a fix.