-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
iOS displays autoCenter: Phaser.Scale.CENTER_BOTH in a way not consistent with results on android and on pc #6862
Comments
For internal use onlyTo address the issue of inconsistent scaling and margins on iOS, follow these steps:
this.scale.on('resize', (gameSize, baseSize, displaySize, previousWidth, previousHeight) => {
// Adjust gameContainer position and scaling here
});
These steps should help resolve the margin and scaling issues on iOS. References/src/scale
|
edited the code sample to be more simple, the key issue is When used on iOS it creates a margin at the top. A fix is being applied on the following urls, although it is undocumented(?) and not part of the code samples it is displaying. https://labs.phaser.io/view.html?src=src/scalemanager\zoom%20manual%20resize.js https://labs.phaser.io/view.html?src=src/scalemanager\fit%20and%20snap.js |
Version
Description
Using Phaser.Scale.RESIZE, for a pixelart game, that fills the browser window size, and scales to a fixed game size. (in this case, 144 by 256).
On PC and android, the code is fine. the gameContainer group is centered in the screen.
On iOS, the gameContainer is pushed down by a margin, and the pixel aspect ratio is squashed vertically slightly. the code doesn't add a margin.
Example Test Code
https://phaser.io/sandbox/A3KSEgq7
Additional Information
tested on iPhone 12
The text was updated successfully, but these errors were encountered: