Fill the entire game screen in the mobile environment

Hello! I’m having trouble getting my game to take up my entire phone screen.

No matter what width and height setting I set in the game, there is always a portion of the screen left unfilled.

See the game configuration:

scale: {
width: 640,
height: 960,
mode: Phaser.Scale.FIT,
autoCenter: Phaser.Scale.CENTER_BOTH
}

If anyone knows how to solve this problem, I appreciate it.

Now see a demo in the image:

A 640 × 960 game will scale to fit perfectly only inside a container of the same aspect ratio (2:3).

1 Like

Here is a plugin for this purpose,

Do you have a suggestion of what would be the ideal dimension to set up a game in the mobile environment?

I’m wondering because, in every game I’m developing, I’m having this problem.