FormularSumo / Galaxy-Collection-Web

Love.JS Web port of https://github.com/FormularSumo/Galaxy-Collection hosted on GitHub Pages
https://formularsumo.github.io/Galaxy-Collection-Web/
GNU Affero General Public License v3.0
2 stars 0 forks source link

Game doesn't always resize correctly #1

Open FormularSumo opened 2 months ago

FormularSumo commented 2 months ago

This can involve any of the following:

It seems to be mostly an issue on mobile rather than desktop, and mainly on Android browsers - more details below. And the Android issues seem to be mostly reproducible on the Chrome desktop mobile emulator, but not on the Firefox one - also see below.

Possible last-resort ideas to help fix

There's also an issue with touch targets (for any input method) not always being correct, but I think that's dependent on this issue

FormularSumo commented 2 months ago

Initial testing results (2024-01-14)

FormularSumo commented 2 months ago

Returning to resizing shenanigans (2024-09-10)

Using mostly default Love.js (pre https://github.com/FormularSumo/Star-Wars-Galaxy-Collection-Web/commit/c9fcd71bc32658ec2589fc61ac2466c6a558d1d8) game doesn't really resize on mobile except sometimes when you enter/exit fullscreen. On the plus side it's never rendered off-screen or stretched. (Check this)

Using this solution: https://github.com/Davidobot/love.js/issues/16 in the Chrome mobile device emulator, until I click on it, the game is always filling the screen, but (CSS) stretching instead of resizing correctly. After I click it doesn't resize at all. And after entering or fullscreen, it works perfectly... On Chrome and Firefox Android it's the same, except you need to exit (as opposed to just enter) fullscreen for to work perfectly. On Safari iOS it works pretty much perfectly. Update: testing on iOS 18 beta with fullscreen API - it doesn't resize when rotating, much like Chrome and Firefox on Android :/ On Firefox desktop/emulator it's same as Chrome except no resizing at all instead of stretching before clicking on the game

If I then add the resizeCanvas function/listener, it causes the game to seemingly never resize (Chrome emulator)...

Using https://github.com/Davidobot/love.js/issues/50#issuecomment-2338513304 doesn't change behaviour except for when in fullscreen, then it stretches instead of resizing on Chrome emulator. Might retest later if I can fix initial resizing not working.