Jump to content

CocoonJS and Nsxus problem


Tom Atom
 Share

Recommended Posts

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?

Link to comment
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...
 Share

  • Recently Browsing   0 members

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