phaser icon indicating copy to clipboard operation
phaser copied to clipboard

Orientation portrait => landscape bug on Coordinates

Open M3K0PZ opened this issue 11 months ago • 0 comments

Version

  • Operating system: Windows 11
  • Browser: Opera GX ( but i don't think it's browser specific)

Description

I try to develop a game in landscape only, I think there's a bug when starting to portrait going into landscape (using resizing game scale mode)

I start in portrait mode (using browser built in phone emulator in console), then i switch to lanscape mode using the "rotate" button, on rotating, if it's in landscape mode, my phaser scenes starts another one, but the logo that should be displayed in the center, doesn't appear (even tho the console log after displaying the logo appears, meaning it's a coordinates issue, the scene still works fine)

what makes me think it's a bug is that if i directly start in landscape (so no resizing), the logo is in the right place, everything works, even if i rotate as much as i want after.

my resize function is only about setting the right coords for the logo and updating world boundaries (see code below)

I also got a similar bug not long ago using the same method, a game i made trying to do some adaptative desing, where going from landscape to portrait worked well to resize and replace every object, image, etc... But not starting from portrait to landscape, where every resizing failed it's job . (even going back from landscape to portrait then landscape worked, it's the starting in portrait only that bugs)

Example Test Code

i use in the code a pleaserotate.js file made on a MIT license jsut to display a "rotate your screen" message if it's in portrait, you can get rid of it, since the rotating listener is made by phaser, it's just graphical and does not take part in this bug.

i made a repo for you to look at the code : https://github.com/M3K0PZ/BugReport_phaser

Additional Information

M3K0PZ avatar Jul 17 '23 09:07 M3K0PZ