Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXACT_FIT scaling does not work as expected on mobile device #2537

Closed
HDouss opened this issue Jun 6, 2016 · 3 comments
Closed

EXACT_FIT scaling does not work as expected on mobile device #2537

HDouss opened this issue Jun 6, 2016 · 3 comments

Comments

@HDouss
Copy link

HDouss commented Jun 6, 2016

This Issue is about (delete as applicable)

  • A bug in the API

I am trying to scale my game like this:

this.scale.scaleMode = Phaser.ScaleManager.EXACT_FIT;
this.scale.pageAlignHorizontally = true;
this.scale.pageAlignVertically = true;
this.scale.forceOrientation(false, true);
this.scale.updateLayout(true);
this.scale.refresh();

My understanding of EXACT_FIT is that it stretches the game so it will fill the entire screen and (much probably) does not keep proportions.

So, there is no chance that the scaled height will be larger than the screen height.

When I try my game in the Intel XDK emulators, scaling works as expected in all the devices suggested in the emulator.

But when I try to install the apk on my phone, or I try to debug (with Intel XDK) on my phone the game scales on width coorectly, but keeps its original height which exceeds my screen height (this.scale.height has the same value as this.game.height).

@HDouss
Copy link
Author

HDouss commented Jun 7, 2016

I figure out the problem happens only if the canvas is appended on a div. If it is appended directly to the body (i.e : 4th arg is empty on new Phaser.Game(.., .., Phaser.AUTO, '');), the scaling is working as expected.

@shanadeshana
Copy link

shanadeshana commented Jun 29, 2016

Thanks for letting me know this, it was making me crazy and I didn't know how to solve it. You saved my life!
The same problem applies to SHOW_ALL
This bug breaks the FullScreen template included in the repo.

@photonstorm
Copy link
Collaborator

Thank you for taking the time to open this issue. However, official support for Phaser 2 has now ended as we focus on preparing Phaser 3 for beta release. In a bid to keep the project tidy, and avoid confusion, we are closing all v2 related issues.

This does not mean your issue won't be looked-at. In November 2016 the Phaser CE (Community Edition) project began. The aim of Phaser CE was to allow the community to continue v2 development. Since then it has gained significant traction, with many updates and releases.

If you are still interested in having your issue investigated we strongly recommend testing the latest Phaser CE release. And only if the problem persists, opening an issue on the Phaser CE repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants