Tom Atom Posted June 16, 2015 Report Share Posted June 16, 2015 Hi, one of my colleagues has problem with our game running on CocoonJS. I am running it on old Samsung Galaxy Tab2 and everything is OK. He has Nexus 7 phone and he can see only about 1/4 of game (tops left corner) stretched over whole screen. When detecting screen size I am using this code (recommended at " Common Phaser + CocoonJS issues" thread): if (!(nav["isCocoonJS"] !== undefined && nav["isCocoonJS"] === true)) { windowWidth = window.innerWidth - 1; windowHeight = window.innerHeight - 1; } else { windowWidth = (window.innerWidth - 1) * window.devicePixelRatio; windowHeight = (window.innerHeight - 1) * window.devicePixelRatio; // Hack to avoid iPad Retina and large Android devices. Tell it to scale up. if (window.innerWidth >= 1024 && window.devicePixelRatio >= 2) { windowWidth = Math.round(windowWidth / 2); windowHeight = Math.round(windowHeight / 2); } // reduce screen size by one 3rd on devices like Nexus 5 if (window.devicePixelRatio === 3) { windowWidth = Math.round(windowWidth / 3) * 2; windowHeight = Math.round(windowHeight / 3) * 2; } }Any idea, what can be the reason? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.