Multiple Resolutions (Solved)

For questions about using Classic.

Post » Wed Jan 20, 2010 4:49 pm

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
B
2
G
3
Posts: 16
Reputation: 882

Post » Wed Jan 20, 2010 9:12 pm

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.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Thu Jan 21, 2010 10:22 am

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...
B
2
G
3
Posts: 16
Reputation: 882

Post » Thu Jan 21, 2010 10:36 am

My Bad,

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

Grrr...
B
2
G
3
Posts: 16
Reputation: 882

Post » Thu Jan 21, 2010 10:48 am

[quote="Madster":1vpaz2nt]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.[/quote:1vpaz2nt]

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.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Thu Jan 21, 2010 10:54 am

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 :(
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Thu Jan 21, 2010 11:02 am

[quote="deadeye":2k23x9n2]
http://dl.dropbox.com/u/529356/zoomAndScroll.cap
v0.99.8[/quote:2k23x9n2]

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.
B
3
S
2
G
3
Posts: 628
Reputation: 2,531

Post » Thu Jan 21, 2010 11:06 am

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 :P
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Thu Jan 21, 2010 11:52 am

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
B
2
G
3
Posts: 16
Reputation: 882

Post » Thu Jan 21, 2010 1:01 pm

Please don't use Megaupload its annoying and slow. Get DropBox or even mediafire is better than that!
B
11
S
3
G
4
Posts: 622
Reputation: 3,186

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests