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
Change Game Size does not handle new aspect ratio correctly #4482
Comments
Another side effect I noticed -- please let me know if that is a different issue. If I set the size initially to say 1000 x 2000 and then change the size (using my workaround) to say 800 x 2500 -- then the webgl will not render anything beyond 2000. In canvas mode it works fine. Assuming these are related, please make sure the fix will address that. |
Thank you for submitting this issue. We have fixed this and the fix has been pushed to the |
The issue is still there. At least after screen rotation with scale mode FIT, if you check scale.displaySize.aspectRatio, it will be always equal initial value. |
I can also confirm that this is still an issue in 3.22.0. |
I just tested the originally opened issue on 3.22 and it works fine, so whatever you're finding it needs opening as a separate issue with a reproducible test case. |
Sorry, I assume it was exactly the same. In my scenario I'm starting up the game with the following settings
. In my primary scene I'm listening for the 'orientationchange' as the code snippet below shows
When orientation is set to landscape and the setGameSize arguments match the original game size, everything works fine, however in portrait mode the resulting height is completely incorrect, resulting in a actual size of 980x550 on my device for a game size of 999x1777. I dont fully understand the code however I believe the issue is stemming from the "constrain" function. On line 76998 As stated before this is on phaser version 3.22.0. |
Sorry, mis-read your comment, i will open a new issue now |
Version
Description
This is my use case. I have two scenes that are of different dimensions. I am starting on Scene 1 and set the size and use Scale Manager with WIDTH_CONTROLS_HEIGHT. When screen size changes e.g. goes below 700px, then I switch to Scene 2. Now I need to adjust the game size so that it uses the new game size but still uses Scale Manager to scale. I expect this to do the job:
However this does not work fully -- the canvas size is not set and the aspect ratio is wrong. In order to fix it I had to "hack" it with the following code:
I expect this should be done (correctly of course to handle all cases) by the set game size.
Example Test Code
Instead of just using the following to be able to resize the game:
I had to use (basically a hack to test):
Additional Information
The text was updated successfully, but these errors were encountered: