How do I set a perfect aspect ratio/resolution for my game?

Get help using Construct 2

Post » Mon Jan 16, 2017 1:05 pm

I have found many articles regarding this issue but do I really have to do all these things or there is a perfect aspect ratio that could somehow work on most of the devices? Which resolution/aspect ratio is the best?

My game has a fixed layout and white background. The objects are bouncing of the layout "walls" (end of the layout) and I'm not sure what will my game look like on different devices.

I assume that if my aspect ratio is larger than the one on the device, my objects will sometimes go off screen (dissapear). If my aspect ratio is smaller that the one on the device, the black screen will appear around my white layout. Am I right?
B
9
S
4
G
3
Posts: 157
Reputation: 2,300

Post » Mon Jan 16, 2017 1:25 pm

there are no ratio/resolution that will fit every screen, especially if you need something to bounce exactly on the "wall"..

so you have to decide how it will "cut" it. read more about the settings. scale inner, scale outer, letterbox etc etc.
B
15
S
4
Posts: 84
Reputation: 1,148

Post » Mon Jan 16, 2017 1:48 pm

So I assume that I have to choose smaller aspect ratio and the rest of the screen will be black?
B
9
S
4
G
3
Posts: 157
Reputation: 2,300

Post » Mon Jan 16, 2017 1:59 pm

sivricmarijan wrote:So I assume that I have to choose smaller aspect ratio and the rest of the screen will be black?



Take a quick look at this or this.

There is no 'perfect' resolution. Can you imagine how many different versions of your game you would have to create to design for every mobile screen.

Yes, your game may not display perfectly on a htc one s screen as it does on an samsung galaxy s8, but that's a trade off. You have to design so it appears to be perfect for that screen it's currently on.
B
38
S
18
G
19
Posts: 664
Reputation: 14,112

Post » Mon Jan 16, 2017 2:03 pm

no ratio fits all screens. to have "to low" or "to high" ratio just tells where the black area will be. it depends on where you prefer.

but read more in the manual. it might be possible to have a perfect solution for you if you redesign your game a bit maybe search for fullscreen scaling
B
15
S
4
Posts: 84
Reputation: 1,148

Post » Mon Jan 16, 2017 2:12 pm

Okay, it's too early for me...I just got what you were asking.

So i think you're gonna need the windowwidth expressions. Or is it viewport?

Search the manual and google for these. This will return the boundary for each device. Problem with that is, it may not be perfect. May be off a few pixels.

Another thing you could do is have rectangle objects that are invisible along all 4 sides of the game's screen. Make them a bit longer and wider, and then create them at the co-ordinates of the phone's screen.

Yes, it does seem like a lot, but there are some very experienced users on here that could do it no problem. It's all about trial and error.
B
38
S
18
G
19
Posts: 664
Reputation: 14,112

Post » Wed Jan 18, 2017 2:34 pm

But if I target 3:2 aspect ratio, my game should work an almost all devices, but a user will see black bars around my game if device aspect ratio is different. Am I right?
B
9
S
4
G
3
Posts: 157
Reputation: 2,300

Post » Thu Jan 19, 2017 2:18 am

sivricmarijan wrote:But if I target 3:2 aspect ratio, my game should work an almost all devices, but a user will see black bars around my game if device aspect ratio is different. Am I right?


First, did you look at the links i posted before?

Basically, if your layout is....say 600x300, and your window is....say 400x200, you want your layout, that 600x300 to be a bit larger. Say 700x400.

Then when you add objects, make sure NOTHING important is close to the edges.

Again, i can not remember the exact expression you need here.

Its either viewport or window expressions. And there will be A LOT of trial and error here.

I do not know if you could actually bounce the ball off the edges of the screen. As i said, adding plain objects to your game then making them transparent and rectangle and placing them at the edges of the screen by way of the viewport or window expression.

(This is wrong, only adding it for an example)
create object - X position.viewport.left +30

Again, that is not the expression but its something like that.

Search the manual for viewport and windowwidth and or do a forum search. Take some time to read through.
B
38
S
18
G
19
Posts: 664
Reputation: 14,112

Post » Thu Jan 19, 2017 6:34 am

I did go through the links you posted...I did it a few times, but I'm not sure where to go next and my game is almost complete, so I want to avoid too many changes. The problem is that both of these articles suggest a game with 3:2 aspect ratio for a safe zone. But I can't find any newer Android device with this aspect ratio. My game has 1280x720 resolution (16:9 aspect ratio) and a letterbox scale and I tried it on at least 10 devices (phones and tablets) and it works fine. Only on tablets it has these black edges but I'm fine with that.
B
9
S
4
G
3
Posts: 157
Reputation: 2,300

Post » Thu Jan 19, 2017 11:45 am

sivricmarijan wrote: ...but I'm fine with that.


First, i wouldn't add tablets to the list of available devices if the game does not play well. IMO it looks amateurish.

Second, if you're fine with that, then...okay.
B
38
S
18
G
19
Posts: 664
Reputation: 14,112

Next

Return to How do I....?

Who is online

Users browsing this forum: DiegoSanudoDT, Yahoo [Bot] and 11 guests