Retro Style, Cameras and Zooming, oh my!

For questions about using Classic.

Post » Fri Aug 12, 2011 6:24 am

Hey guys!

So I'm trying to make a retro style game here. No real biggy, except that I'm having problems with zoom rates and fullscreen and such.

I've got pretty much the setup Ashley came up with here, except I'm using Magicam.

The problem I run into is that I can't seem to use layout sizes smaller than the window/screen resolution. In this case if I have a 640x480 layout, any window size larger than that and the camera starts to lose its focus on its target, and ends up showing stuff outside the layout (in this case, the white layout background). If the layout is larger than the window/screen size, everything works. Unfortunately system resolutions are variable from computer to computer, and I'd rather not have to have 4000x4000 layouts for just a single room. It'd also be pushing it for a small town in my game.

I need a way to keep the camera focused on the player properly and to stay within the confines of the layout while zoomed in. Anyone got any ideas?

Here's my cap:
http://dl.dropbox.com/u/20459682/eclipse.cap
B
56
S
20
G
7
Posts: 305
Reputation: 8,754

Post » Fri Aug 12, 2011 7:08 am

I don't see anything wrong with having a large layout?
B
134
S
65
G
16
Posts: 1,765
Reputation: 19,188

Post » Fri Aug 12, 2011 3:47 pm

The layout in fullscreen would have to be at least as large as or larger than your system resolution. I can't predict a system's resolution and I'd also like to be able to future proof. Plus, making 4000+x4000+ layouts isn't a good solution.
B
56
S
20
G
7
Posts: 305
Reputation: 8,754

Post » Sat Aug 13, 2011 7:27 pm

Well I came up with a workaround that'll hopefully keep working as I get farther along in my project. Figured I'd post my hack of a fix here in case someone else was having a similar issue.

Basically what I did was set a condition comparing the layout size to the resolution size. If the layout size is smaller than the resolution size, then it resizes the layout to match the screen resolution.



After that, I set the magicam camera up with gridscrolling. That way the player's view will still be restricted to being inside the layout.

The only bug I have right now is upon switching from windowed to fullscreen, where the camera position is set to the top left corner for whatever reason. When the player gets back onto the screen it begins to scroll like normal again. I tried having the camera automatically move to the player when changing to fullscreen, but to no avail. Oh well, I'll try to figure something out.
B
56
S
20
G
7
Posts: 305
Reputation: 8,754


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests