FormularSumo / Galaxy-Collection-Web

Website/Web App version of the game hosted on GitHub Pages
https://formularsumo.github.io/Galaxy-Collection-Web/
GNU Affero General Public License v3.0
2 stars 0 forks source link

Low resolution on devices which scale web content (Android, iOS, laptops) #2

Open FormularSumo opened 2 weeks ago

FormularSumo commented 2 weeks ago

Instead of the device's hardware resolution being used for Love2D/Canvas rendering, its virtual web one is. This means on modern Android/iOS devices it runs at around 1/2-1/4 of the resolution it should and looks really bad. Sometimes even making it hard to use interact with the game eg reading text.

FormularSumo commented 1 week ago

Turns out this is also a problem on some desktop devices (most laptops), just not as noticeable. My laptop has an 1800p tall display, but the css pixels is 900p - which correspond with OS device scaling of 200%. You can see in this recording that the web version (both Firefox + Chrome) is noticeably blurrier than native (even though native is only rendered at 1080p then upscaled).

https://photos.app.goo.gl/vxRHZypGoZ7nSHT39

FormularSumo commented 6 days ago

https://stackoverflow.com/questions/53233096/how-to-set-html5-canvas-size-to-match-display-size-in-device-pixels https://web.dev/articles/canvas-hidipi Seems like the solution. I have yet to get it working yet though, as it seems like love.js is doing some of its own canvas resizing :/

https://web.dev/articles/device-pixel-content-box also exists but is a bit more complicated and doesn't work on Safari yet.