Is it possible to resize a game to fit the window size?
For example if the native sizing is 1920X1080, and I want to resize it to 1024X768, to play in a small window, is it possible to have everything inside the window resized to fit the screen?
A good example is Slay the Spire which does this well and starts natively in a small window, but can be resized up.
I noticed that GD’s options for this state: “games running in browsers or mobile phones cannot update their window size.” So maybe this is preventing this from happening.
Are there any workarounds people have seen?
There is an option to change game resolution in game settings from where you view scenes and global variables
Still doesn’t work. It’s changing the window size, but other than that, objects, sprites, grids, etc., stay the same size I mean.
I literally just played slay the spire today on my PC, and changing the window size just scales all of the assets up/down as if you were zooming in, to keep the aspect ratio.
If thats all you are wanting, ensure that the “adjust resolution” check box is not checked in your project properties. Then choose a scaling mode that makes sense (width, height, or do nothing).
Here’s what’s happening, window is getting smaller, but nothing else is.
Here’s what I have just to test this condition:
And this is what the game properties are:
Just to avoid any misaligned expectations: Slay the spire is made in LibGDX. That uses java, not JS. Very different languages that just happen to share a word in their names.
You broke your setting change. By selecting “automatically adjust game resolution yes” in your actions you have made it basically recheck that stting in project properties.
Oh you know I just realized, you could in theory just basically cheese the whole thing by changing the camera zoom on resolution changes, right?
Edit: maybe, probably not