marchhill Posted February 16, 2018 Share Posted February 16, 2018 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... Link to comment Share on other sites More sharing options...
marchhill Posted February 17, 2018 Author Share Posted February 17, 2018 Bump Link to comment Share on other sites More sharing options...
marchhill Posted February 17, 2018 Author Share Posted February 17, 2018 Aha found it. Cordova does not acknowledge the meta viewport tag, it assumes a responsive design. This means you have to change the canvas size to be window.innerWidth and height and it will work. Link to comment Share on other sites More sharing options...
Recommended Posts