0 Favourites

Retro Style, Cameras and Zooming, oh my!

This forum is currently in read-only mode.
  • Hey guys!<img src="smileys/smiley4.gif" border="0" align="middle">

    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.<img src="smileys/smiley24.gif" border="0" align="middle">

    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

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • I don't see anything wrong with having a large layout?

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

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

    <img src="http://img51.imageshack.us/img51/8809/fullscreenevents.png" border="0" />

    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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
167 39,769
lucasgc1's avatar
lucasgc1
Unread hot topic
102 11,888
Katala's avatar
Katala
Unread hot topic
0 Favourites
Dangerous Dave style shooting?
48 1,877
newt's avatar
newt