How do I make unbounded scrolling limited?

  • 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?

  • 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:

    clamp(scrolly, 0, CombinedHeight)[/code:2ad69kcr]  
    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.
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thank you very much! Will do this when i get home.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)