- Home /
How to start Scroll Rect content off screen
I want to build scrolling credits with the UI system Scroll Rect component. The text should move from below the visible screen area upwards into the screen and then keep scrolling. I can think of several ways of building it, I'm actually getting stuck at how to set it up in a clean way.
In the attached image you can see the white screen area. The "Content" object has a Content Size Fitter and Vertical Layout Group. This way I can place an empty panel as a "Spacer" in front of my texts (which will be read from a text file and layouted automatically at runtime).
This works, but has different problems: 1) The spacer needs to have a fixed size, which always should be the height of the screen. Ideally I would want to use anchoring, pivots or some clever layout to achieve my desired result. 2) Setting the size delta from a script to the screen height doesn't appear to translate correctly, when using the Canvas Scaler component and Scale With Screen Size. Is there some conversion formula I need to apply here? The displayed and used size delta height seems to be proportional to some factor between screen height and reference resolution.
Shouldn't this setup be a simple two or three click action? Maybe I'm not seeing the correct approach, but there should be a way to define that the scroll content should expand exactly one screen height above and below the actual content. Maybe some kind of envelope in parent option?
Thanks for any suggestions! :)