Author Topic: Minimum Height for a Label?  (Read 3279 times)

Samhayne

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
Minimum Height for a Label?
« 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...



... 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....



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





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.
« Last Edit: October 16, 2014, 08:55:04 AM by Samhayne »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Minimum Height for a Label?
« Reply #1 on: October 17, 2014, 04:46:53 AM »
TypewriterEffect already handles this. Check the "Keep Full Dimensions" checkbox.

Samhayne

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: Minimum Height for a Label?
« Reply #2 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
« Last Edit: October 20, 2014, 10:33:44 AM by Samhayne »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Minimum Height for a Label?
« Reply #3 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.