Jump to content

Getting Phaser and Cordova viewports to play nice


marchhill
 Share

Recommended Posts

I am currently creating a puzzle game app using Phaser and Cordova (crosswalk) but I am having some trouble with the meta viewport tags.

Testing the game on my android phone with cordova, no matter what I set my meta viewport tag, the game is always extremely zoomed in on one small area of the canvas.

However the reason I think this is a viewport problem, is that on chrome, when I set the meta viewport to this:

<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">

I get the exact same problem as in cordova, however when I don't set it at all, or set it to something like this:

<meta name="viewport" content="user-scalable=no, width=3000">

The game runs perfectly fine! How can I fix this so that the canvas and cordova viewport will both work?

Details:

Phaser version 2.6.2

Phone model - Samsung Galaxy S7

P.S. Apologies if this is more of a Cordova problem I was not sure. A final thing I did with Cordova (if anyone has any experience with it) is set this in the config:

<preference name="EnableViewportScale" value="true" />

Still no luck...

grid-game-error.png

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...