Constraining camera scrolling to the layout boundaries?

For questions about using Classic.

Post » Fri Feb 25, 2011 7:31 am

Hello!

I'm trying to set-up a simple top-down view strategy game, and am having the display follow the player's mouse cursor to pan around the map (the X & Y Scroll Ratios tweaked to 70). The problem is that the player can scroll the display right off of the map.

Is there an easy way to constrain display movement to the boundaries of the layout, so that a player can't pan the camera out into the great white void?
B
1
G
1
Posts: 8
Reputation: 441

Post » Sat Feb 26, 2011 7:40 pm

Do you have unbound scrolling checked? That's the only way I could even get it to scroll past the boundaries without knowing how you set it up. If it's not checked (found in Layout Properties), then post the cap so people can see what you did to get an idea of how to fix it.
B
2
G
1
Posts: 22
Reputation: 494

Post » Sat Feb 26, 2011 8:44 pm

unbounded scrolling works, but will restrain the camera even further than it has to if zoomed in, and I think maybe not enough when zoomed out

this should work for any zoom level:
note: uncheck center view on me for the object and just scroll to object through an always event
[url]
http://dl.dropbox.com/u/1013446/scroliinthang.cap[/url]
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests