• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Windows Is there a way to save the player's window resize/positioning preferences?

otterZ

Member
I have window resize enabled in preferences, so the player can resize it and position the game window in the top left corner or wherever they want it and whatever size they want.

However, when the game is closed down and reopened, the game window goes back to being in the centre at a default size.

Is there any way to save the position of the window after being manipulated by the player? So that when the game is shut down and reopened the game window restarts in the same position and at the same size, as when the player closed the game down?

This way players wouldn't have to resize and reposition the game window to their liking every time they shut down and reopen a game.
 

xenoargh

Member
Yes. Save to an INI. Read the INI and re-execute the scale / position upon game-start, if the values have been initialized. Make sure you have a nice automated way to reset it, though; if they buy a new monitor, rescale their resolution, etc., it could cause more trouble than it solves!
 

otterZ

Member
Yes. Save to an INI. Read the INI and re-execute the scale / position upon game-start, if the values have been initialized. Make sure you have a nice automated way to reset it, though; if they buy a new monitor, rescale their resolution, etc., it could cause more trouble than it solves!
Thanks xenoargh, that's great. I see what you mean about it maybe being thrown out with a resolution change or new monitor, good point. In that case I will add it as a configuration, initially turned off, with instructions to press 'r' on the keyboard to reset the game window to default if this configuration is turned on by the player but is thrown out by a new monitor/resolution change.
 
Top