Multiple Resolutions (Solved)

This forum is currently in read-only mode.
From the Asset Store
Adjusting the game screen for different resolutions (Letterbox scale)
  • Hi Guys,

    I know, that there are quite a few threads with this topic already, but I still feel the urge to ask this question about resolutions in Construct.

    I have difficulties to understand how Construct handles the change of a resolution. I want to have the possibility for the player to set his resolution if he wants to. What are the steps I need to take?

    So far I got:

    System: Change display size to 1280x 1024

    System: Switch to Fullscreen mode

    This changes the actual reolution the monitor is working with, but my layout is small in the right upper corner.

    If I use System: Set Zoom to (200,200), I get a bigger layout, but its not positioned right.

    If I use System: Set layout size to 1280x 1024, the layout gets bigger, but the content won't.

    If I use System: Set Layer 1 zoom rate to (200x200) nothing happens.

    I really am quite confused about this. What I want: I have a layout that is done in 1024x768, the standart solution of my game. For the 800x600 and the 1280x1024 resolution I want the monitor tobe in that resolution and scaling the game, so no black bars are seen. For widescreen resolutions I want the maximum possible height, and black bars left and right.

    So what are the steps I have to do in order to get it right?

    Greetz and thanks

    Maenny

  • If you start with a small layout and then you try to enlarge it, you'll find out that Construct doesn't draw outside the layout even though it's zoomed, which makes sense (this could be useful for the Black Bars thing).

    So you'll have to also enlarge your layout. But since your layout is larger now, you'll also have to scroll it. I'm still working on the math for that, it goes all weird tho, there's some bugs around. So far, scrolling to the center of the original layout size works for me, but you gotta set scrolling to unbounded (BUG?), and if I set the scroll from the same function object event I use to change the resolution, it won't scroll.

    I shall post a .cap with all of this. Soon.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think you have to use the Window-object. When I do:

    Window Set Size to: 800x600

    System: Switch to Fullscreenmode

    it seems to work.

    I'll have to try with different resolutions...

  • My Bad,

    if I do that, it doesn't change the resolution of the monitor.

    Grrr...

  • If you start with a small layout and then you try to enlarge it, you'll find out that Construct doesn't draw outside the layout even though it's zoomed, which makes sense (this could be useful for the Black Bars thing).

    So you'll have to also enlarge your layout. But since your layout is larger now, you'll also have to scroll it. I'm still working on the math for that, it goes all weird tho, there's some bugs around. So far, scrolling to the center of the original layout size works for me, but you gotta set scrolling to unbounded (BUG?), and if I set the scroll from the same function object event I use to change the resolution, it won't scroll.

    I shall post a .cap with all of this. Soon.

    It's not a bug, the actual rendered viewport is scaled up. Under normal circumstances this means your player can be off the screen and because of bounded scrolling you won't be able to actually get all the way to the edge. You need a method to keep move past the edge of the screen but visually stop short of the layout boundary.

    The trick to fixing scrolling when you zoom the screen is to set the layout to Unbounded Scrolling, but use clamp() to create your own bounds.

    I have an example here:

    http://dl.dropbox.com/u/529356/zoomAndScroll.cap

    Edit: v0.99.72

    Press F when running for fullscreen, press W for window. Notice that when it is zoomed (at fullscreen, it is zoomed 200%) the scrolling works normally. This is handled in the bookmarked event of the Display sheet.

    The screen zooms 2x, and the regular display size is 512x384, so the scrolling limits for clamp() are half that in each direction for the fake bounding. If you were to scale the screen at a different ratio, you would have to adjust those bounds accordingly. At 4x zoom you would have to quarter the base resoution, etc.

  • As for the whole black bars thing for adjusting for widescreen, I used to have an example of that somewhere but I can't find it now and I'm too busy to make another one at the moment

  • http://dl.dropbox.com/u/529356/zoomAndScroll.cap

    v0.99.8

    On saving that cap from construct, it tells me it was previously saved in an earlier version, not 99.8. Just thought I'd mention, and make my token post for today.

  • Oh, really? Hmm... I guess it did open and save in 0.99.72. Okay, then, thanks for the heads up. Having multiple versions installed can get confusing

  • Ok I got it to work. As I see many have this problem with resolutions, I thought I'd share. Basically, this cap can be adapted to every resolution using the math I Intergrated. Important: Set the scrolling of your app to unbound.

    http://www.megaupload.com/?d=DL53470R

    The only 'bug' I found was that scrolling has to be done a few steps after changing the resolution. Thats why I have the (not so elegant) count-up of the scroll var.

    Greetz

    Maenny

  • Please don't use Megaupload its annoying and slow. Get DropBox or even mediafire is better than that!

  • Man, if you really think 63KB on Megaupload is too slow, just don't download it. For me megaupload works fine, and it is what I use. Annoying are only the posts requesting other downloaders than the ones already used.

  • I don't mean the download speed is slow but waitin 40secs to get to download it IS SLOW. Compared to Dropbox where you can just drop file into folder that is on ur pc and then right click and copy public link there you have it!

  • Sagal may be rude, but he's also right. Megaupload is terrible.

    The preferred hosting tool on the forum is Dropbox, for two reasons:

    1: It's quick and easy to upload (just drag your stuff into a folder on your computer)

    2: It's quick and easy to download (just post a direct link... no waiting, no ads, no captcha)

    I generally don't even download people's examples from Mediafire, let alone Megaupload. It's not an elitism thing, it's a "those sites are really annoying if you're downloading 20 .caps a day from different people" thing.

  • Hi Maenny...

    Do you have a copy of your CAPX available still? Looks like MegaUpload is being blocked by johnny-law while it's proprietor is under investigation.. :(

    Let me know!

    -Remy

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