Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: kruncher on October 20, 2013, 10:21:56 AM

Title: Scrolling panel with simple text
Post by: kruncher on October 20, 2013, 10:21:56 AM
I have created a simple scroll view which has a vertical scrollbar, a scroll panel which contains a simple label. The label has a collider and the "UIDrag Panel Contents" script attached.

The text of the label changes throughout play, but the collider doesn't update to reflect the size of the text.

What is the best way to keep the collider size sufficiently large so that the content can be dragged? or... should I just make the collider very large to begin with?
Title: Re: Scrolling panel with simple text
Post by: ArenMook on October 20, 2013, 06:06:08 PM
Set up your label with Wrap or Shrink Content instead of Resize. This way its dimensions will be fixed to begin with.
Title: Re: Scrolling panel with simple text
Post by: kruncher on October 20, 2013, 06:14:40 PM
I have specified "Resize Height" for my label since it grows as things are logged. So yeah the width is certainly fixed, though the height will gradually increase.
  1. if (logLabel.text != "")
  2.     logLabel.text += "\n";
  3. logLabel.text += "Something happened!";
  4.