How Do I Create a Scrolling Text Window in Unity 4.6?

I’m having a lot of trouble trying to understand the documentation for ScrollRects in the new UI system. It looks like any ScrollRect has to be contained in a Panel object for some unknown reason, and like there’s some constraint causing the Panel to either be the size of the screen, or (if reduced) to squash the actual ScrollRect to a tiny size. What do I need to do to set up a simple, large scrolling window with a block of text in it?

I just put that in myself from this Brackeys video:

If I hadn't seen that video I don't think I'd have ever figured it out!

You should be able to create a panel with a ScrollRect component and then child your text to it. On the Panel with the ScrollRect put your text as the content.

Doing all this without testing first which normally goes really well!

You can also put a mask on the panel with the ScrollRect and attach whatever scrollBars you want.

Just tried it and it works! If you put a ContentSizeFilter on the panel and drag the text so it’s doesn’t truncate the text at all. That’s the text you’re expanding not the panel.

EDIT:

OK now I’ve finished what I’m doing, ignore all the other bit’s just look at the textScrollRect and child Text content…

37365-textscrollrect.png

That’s what the parent panel looks like and it has this as it’s additional components

37366-textscrollrect2.png

And I’ve reached my attachment limit. I’ll add a comment for the screen grab of the Text content.

[75687-scrollingtext.zip|75687]

I have uploaded a working sample after wasting a few hours on this. The above solution didn’t work perfectly.