How do I make unbounded scrolling limited?

Get help using Construct 2

Post » Wed Jan 28, 2015 3:07 am

Hi there! I tried to google this, but with no luck.
So, what i need is: dynamically create unlimited amount of objects, one under another, by pressing "button", then i want to scroll up and down (like forum posts). I turned on "unbounded scrolling" and it worked fine, except i need to limit that scrolling by existing objects (one on top and one on bottom). Any ideas?
Last edited by SinSpirit on Wed Jan 28, 2015 4:17 am, edited 1 time in total.
Posts: 2
Reputation: 179

Post » Wed Jan 28, 2015 3:35 am

Find out the combined height of all of your stacked objects, then every tick set the Y-scroll(Scroll to Y in System object) to something along the lines of:

Code: Select all
clamp(scrolly, 0, CombinedHeight)

This will set the Y-scroll to its current value bounded by 0 and the combined height of your objects.

Ideally, this should be the last action in your event sheet so that prior events which change the Y-scroll don't override your bounding.
Posts: 1,586
Reputation: 19,196

Post » Wed Jan 28, 2015 4:18 am

Thank you very much! Will do this when i get home.
Posts: 2
Reputation: 179

Return to How do I....?

Who is online

Users browsing this forum: GloryF90 and 2 guests