-
Notifications
You must be signed in to change notification settings - Fork 28
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
When refreshing the window the minwidth and minheight is used sometimes #16
Comments
Huh! This may be related to times when the game window just doesn't show up randomly. Good spot. Probably a race condition on window initialisation between SDL and the JS. EDIT: as described here: https://love2d.org/forums/viewtopic.php?f=12&t=81736&start=140#p235945 |
I have seen the same behavior, and perhaps found something interesting. We tried changing the way the canvas is shown once the loading is done. Instead of changing the canvas' style from To be clear, the canvas always has That seems to make a difference. Worth a try? |
I was able to fix these problems using a couple changes in order to create a fully responsive game that fills the screen on both desktop and mobile.
As @kraybit suggested, I used the following properties on the canvas:
I can't explain why this has to be a square ratio, but without it the image was distorted on mobile.
I put the following properties on my canvas to make it cover the screen.
I had to make some changes to the viewport meta tag. Again, not 100% what the logic of this change is, but without it the image was improperly scaled on mobile. This is my index file. |
Assuming solved but will pin as useful. |
Tested this mainly on Chrome, but I believe this happened on Firefox as well.
Happens with both release and compat version.
This is my conf.lua:
minwidth
andminheight
, instead of the set width and height.It does not matter if
t.window.resizable
is true or not.The text was updated successfully, but these errors were encountered: