Page 1 of 1

How do I make unbounded scrolling limited?

PostPosted: Wed Jan 28, 2015 3:07 am
by SinSpirit
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?

Re: How do I make undounded scrolling limited?

PostPosted: Wed Jan 28, 2015 3:35 am
by linkman2004
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.

Re: How do I make unbounded scrolling limited?

PostPosted: Wed Jan 28, 2015 4:18 am
by SinSpirit
Thank you very much! Will do this when i get home.