vastron

Phaser 2 PWA Scaling Issue

Recommended Posts

Hello,

I created a pwa with Phaser 2, following this tutorial https://phaser.io/news/2018/10/progressive-web-apps-tutorial

I face a problem with how the game scales on mobile.

In my game I use these Phaser 2 methods:

game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;
game.scale.pageAlignHorizontally = true;
game.scale.pageAlignVertically = true;

When I click the localhost link in my mobile,

 the game is way too big and when I 'download' it to act like an app, it gets really shaky at first, scaling up and down until it settles to the correct size. 

The game dimensions are 1280x720.

It looked very nice before I converted it to a PWA.

I did an audit for a PWA in Chrome's dev tools and it showed this notification:

The viewport size is 1280px, whereas the window size is 412px.

Do you have any idea on how to fix this issue?

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.