How do I scroll screen?

1 favourites
  • 4 posts
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • I already found edge scroll tutorial on this website. And i downloaded demo of it and modified to my needs.But i would like to scroll outside of left and upper layout border. I think that here is the problem with position of window.

    Right now layout in Construct 2 is like this:

    Is it possible to change it like this:

    If i enable Unbounded scroll i can go in every direction, but there is no limit, so that's not solution. I attached my project file, so you can check it out. Is there any workaround to enable this kind of edge scrolling?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have done this for my game but I fear its not a simple proses. If the play space is 1000u x 1000u and your viewport is 300u x 100u then you will need to set up a number of conditions. For scrolling left

    For every tick MouseX is less than or equal to ScreenX-50u & If ScreenX is Less than or equal to LayoutX 0u. Then scroll 10u at 180deg (Left).

    //

    this will move the screen 10 units to the left every tick(or smaller depending on scale) As long as your mouse's X position is to the left 50u to the screens center. And the second condition will stop it moving left as again your view port has a X,Y coordinate. So if your screen's X is less than or equal to your viewports X it will keep moving left every tick till the second condition is rendered false

    This is then repeated for Right 0deg, Up 90deg, and Down 270deg. And I hope this helps

    //

    *u in this case is just "units" be they pixils or inches

  • ok, thanks! i will try this in my game!

  • or you can learn from here

    https://www.scirra.com/tutorials/1027/p ... -scrolling

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