How do I scroll screen?

Just started using Construct 2? Post your questions here

Post » Sun Dec 07, 2014 9:36 pm

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

Is it possible to change it like this:
Image

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?
You do not have the required permissions to view the files attached to this post.
B
14
S
3
G
1
Posts: 95
Reputation: 1,015

Post » Thu Dec 11, 2014 5:53 am

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
"Were all mad here. I'm mad, your mad." "How do you know I'm mad?" Asked Alice. "You must be" Said the Cheshire Cat. "Or you wouldn't have come here"-Lewis Carroll: Adventures In Wonderland
B
7
S
2
Posts: 113
Reputation: 1,245

Post » Thu Dec 11, 2014 12:44 pm

ok, thanks! i will try this in my game!
B
14
S
3
G
1
Posts: 95
Reputation: 1,015



Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 5 guests