You are currently viewing the GMLscripts.com static mirror. Forum access and script submissions are not available through this mirror.

Invert GMLscripts.com

save_screenshot

Saves a successively numbered screenshot within the working directory.

save_screenshot("test","folder\");
save_screenshot("test","folder\");
save_screenshot("test","folder\");
save_screenshot("test","folder\");
//  files created:
//      %USERPROFILE%\AppData\Local\<game-name>\folder\test_0.png
//      %USERPROFILE%\AppData\Local\<game-name>\folder\test_1.png
//      %USERPROFILE%\AppData\Local\<game-name>\folder\test_2.png
//      %USERPROFILE%\AppData\Local\<game-name>\folder\test_3.png
save_screenshot(name,folder)
Saves a successively numbered screenshot within the working directory.
COPY/// save_screenshot(name,folder)
//
//  Saves a successively numbered screenshot within the working
//  directory. Returns true on success, false otherwise.
//
//      name        prefix to assign screenshots, string
//      folder      subfolder to save to (eg. "screens\"), string
//
/// GMLscripts.com/license
{
    var i,fname;
    i = 0;
    // If there is a file with the current name and number,
    // advance counter and keep looking:
    do {
        fname = working_directory+"\"+argument1+argument0+"_"+string(i)+".png";
        i += 1;
    } until (!file_exists(fname))
    // Once we've got a unused number we'll save the screenshot under it:
    screen_save(fname);
    return file_exists(fname);
}

Contributors: Grand-High Gamer

GitHub: View · Commits · Blame · Raw