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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.