jf_knight
Member
I want to have the user click a settings menu button and toggle through "full screen" and "windowed" settings (everyone is familiar with this common function, right?). I've encountered a problem where I can toggle through the settings but the change wont save (it reverts back to its default setting every time the game starts). I'm using an .ini file to save this settings. Here is what I have...
- in a PERSISTANT object I have pasted on the starting room, in a "create" event...
- on a script, activated when the button is hit, I have...
- Finally, in the "scr_fullscreen" script, I have
- in a PERSISTANT object I have pasted on the starting room, in a "create" event...
Code:
ini_open("game_settings.ini");
full = ini_read_real("settings","full",0);
ini_close();
scr_fullscreen();
Code:
if (window_get_fullscreen() == false)
{
var fullscreen = 0;
}
else if (window_get_fullscreen() == true)
{
fullscreen = 1;
}
window_set_fullscreen(fullscreen);
ini_open("game_settings.ini");
ini_write_real("settings","full",fullscreen);
scr_fullscreen();
Code:
if (window_get_fullscreen() == false)
{
var full = 1;
}
else if (window_get_fullscreen() == true)
{
full = 0;
}
if (full == 1)
{
window_set_fullscreen(true);
}
else
window_set_fullscreen(false);