Aspect Ratio

For questions about using Classic.

Post » Thu Oct 02, 2008 9:25 am

Well, by now you know where all the settings are, and you have the basic idea of what needs to get done. I guess if it's not working for you then post your .cap so someone can take a look at it to see where it went wrong.

Just about everyone here is willing to help... but if you show what you have so far, people will be more likely to help you figure it out.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Fri Oct 10, 2008 5:35 am

this is exactly what i want to do -- have it run widescreen, and if it's set to a 4:3 resolution, add black bars so that the viewable area is never effected. i wish someone would make an example -- i'm not having any luck.
B
2
S
2
G
4
Posts: 254
Reputation: 1,958

Post » Fri Oct 10, 2008 6:19 am

Zooming each layer is about the only way to do it... I had to do it like that with Chamber. The problem I am having is that the game runs by default in 4:3 ratio, and if I try to make it adjust the window size to something other than a 4:3 during runtime, it won't do it.

I am more than happy to post a cut down cap file of chamber if you guys want, so you can see how I did the resolution thing, but it only works in 4:3 aspects.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Fri Oct 10, 2008 8:01 am

Here: http://www.fileshack.us/get_file.php?id ... aspect.cap

This example tests the user's desktop resolution to determine if they have a 4:3 (1.33) or 16:9 (1.78) monitor.

The black bars are manually placed based on some simple math.

This example will only go fullscreen if you have your desktop resolution set to a 1.33 or 1.78 aspect ratio, but you could test for other ratios as well and set them accordingly.

I didn't get a chance to test this on my 16:9 monitor, but I'm pretty sure it works (I faked it by setting my 4:3 monitor to a 16:9 resolution and didn't see any black bars when I went fullscreen, so yeah, I think it works.) Even if it doesn't work, it should give you an idea of how to make it work.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Fri Oct 10, 2008 8:29 am

How about doing the same for a 16:10 monitor? (1440x900)
Could you please add that to the .cap?
B
2
S
1
G
4
Posts: 92
Reputation: 1,384

Post » Fri Oct 10, 2008 8:35 am

[quote="Kr!s":1m79j9z6]How about doing the same for a 16:10 monitor? (1440x900)
Could you please add that to the .cap?[/quote:1m79j9z6]

I have faith that you could figure out how to do it ;)

Give it a try at least. Everything you need to know is right there in the .cap. It's just a matter of working out the math and fiddling around with things until it works right. The math is pretty simple, even for me (I totally suck at math).
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Fri Oct 10, 2008 8:52 am

Yeah you were right, I did found the correct numbers. :)

And I have another question.
This is a static thing, and the screen is centered to the red circle.
How can you apply this to a game with a moving object?

EDIT: I just tried setting the bars at the top-left of the layout with unbounded scrolling. Looks like that could work.
B
2
S
1
G
4
Posts: 92
Reputation: 1,384

Post » Fri Oct 10, 2008 10:00 am

I totally nailed this :D
Thanks for the nudge, deadeye.

I added support for 4:3, 16:9 and 16:10
Check this files out:

Fixed ratio for a 640x480 application:
http://www.fileshack.us/get_file.php?id ... ect640.cap


Fixed ratio for a 800x600 application:
http://www.fileshack.us/get_file.php?id ... ect800.cap


The weird window resolution is to compensate for the borders of the window itself.
Also the 1.25 screen ratio is for 1280x1024.
B
2
S
1
G
4
Posts: 92
Reputation: 1,384

Post » Fri Oct 10, 2008 11:04 am

No problem, glad you got it all sorted out :)

Putting the black bars on the top layer with no scrolling is a nice touch (though your bottom bar on the 800x600 version needs a little adjustment ;))
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Apr 21, 2009 4:02 pm

Hi everyone,

Sorry to bump an older thread but I could really use those example files, (being new to construct) and all the links now appear tobe dead. :( Could someone repost an example file please?
B
2
S
2
G
4
Posts: 124
Reputation: 1,698

PreviousNext

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests