melonjs / melonJS

a fresh, modern & lightweight HTML5 game engine
https://melonjs.org
MIT License
5.92k stars 643 forks source link

boilerplate v6 does not correctly resize #1078

Closed dynamo-foundation closed 2 years ago

dynamo-foundation commented 2 years ago

If you are submitting a bug report, please respect the below template :

OS platform / Browser

Win 10, Chrome, mobile safari, others

melonJS version

10

Bug description

Platformer example using old boilerplate will auto-resize and fullscreen using CSS/HTML. New boilerplate does neither and incorrectly sizes or fails to resize at all on mobile.

Steps to reproduce the bug

Open platformer example in a browser and then resize - window sizes/scales to fit. Install boilerplate v6 from repo and load in dev mode (npm run dev) - resize browser - does not resize and scroll bars appear instead.

Platformer demo: https://melonjs.github.io/examples/platformer/

Boilerplate hello world: https://github.com/melonjs/es6-boilerplate

Console log Extract

N/A

How to enable/use the console log
obiot commented 2 years ago

this is clearly a bad regression in the 10.x branch..... funnily I never noticed it because I almost always keep the debug panel visible, and when visible the resizing is behaving as expected.... kind of strange !

dynamo-foundation commented 2 years ago

All that's needed is to place in the old (version 5) index.html and index.css and it works like the platformer.

obiot commented 2 years ago

really ? this one has been driving nuts.... as I thought something was broken somewhere in the actual code..... 🤦‍♂️ let me try !

obiot commented 2 years ago

Hi @dynamo-foundation , I restored the html & css template to what they were in the es5 boilerplate https://github.com/melonjs/es6-boilerplate/commit/6d41bd3f6f700a4b047900d6b473b2f2c93c3a23

if you can also confirm on your side this is now behaving like you expect ? thanks :)