How to enable game size stretching?

So i am making a game for android with the base resolution being 1080x1920 but i realized that many phones have different aspect ratios, so how do i fill the gap without black borders or showing an extra part of the scene? I would like to enable stretching the game and dont mind the sprites being stretched :slight_smile:

You also have different actions for this, but the default in Project properties should work.
03

2 Likes

It should but it isnt, when i preview the game, it also shows the grey area outside of the main scene. I have tried to workaround it but the only other option is to disable the resolution change option but then i have black bars. It works fine on a phone which has 16:9 ration but not on any other. Hope you understand :slight_smile:

Hey @jack, this is the problem I am facing as well. Using “Change width to fit the screen or window size” it only puts the game on the left side of the screen and right side becomes grey.

Is there a way to automatically fit to the screen size it is run into?

there is a “center the game window on the screen” command in the list

@Shaheryar @knightMash
Sorry I don’t know, I’ve never created a game in portrait mode, maybe someone else can help.
Filling the right gray area is easy by placing something at this point.
I think that only looks okay if it’s a platformer and you’ll run to the right.
I don’t know your game, the “center the game window” action could help.
And jup the fact is, many have problems with it and it’s frustrating. Maybe it should be revised, simplified, or clarified.
Here is e.g. an idea for predivined resolutions https://forum.gdevelop.io/t/preset-resolutions/25941

I did use that

but still it doesn’t take up the size of the window available as shown below

thanks for help, appreciate it :slight_smile:

@Shaheryar did it work for you? If yes, could you point out how you did it?

no the streching part didnt work for me so i just disable resolution change in the properties window. so now only the game windows is shown, no grey area but there are black borders if you change resolution to a bigger aspect ratio.

@Shaheryar does it looks something like this for you on the browser

and an additional black borders on the top and bottom on a mobile browser ?

This has been a problem for me too too. So in my game I’m creating a big border around the main game screen. It’s quite easy to do. You could just add a bunch of mountains all around the border for your tank game. Or you could add more sand. Just make sure it’s filled all around with something so it looks nice. Not ideal situation but just a workaround suggestion. You could also change the Z-order of your border object so that the sprites will disappear behind the border.

yes but i havent tried on the browser