Poll the Steam API to check for a screenshot being taken.


GML Code Example


Returns: Boolean


This function will poll the Steam API to see if the key for taking a screenshot of the game has been pressed. The function will only return true for one step (game tick) if the key has been pressed, and will return false at all other times.

NOTE: this does not take a screenshot for you. This only signals that the key has been pressed and you must use the GameMaker: Studio functions screen_save or screen_save_part to save a local copy of the file to be uploaded.


GML Code Example

if steam_is_screenshot_requested()
    var file = "Catch_The_Haggis_" + string(global.scrn_num) + ".png");
    steam_send_screenshot(file, window_get_width(), window_get_height());
    global.scrn_num += 1;

The above code will poll the Steam API for a screenshot request and if it has been, a unique name for the image file will be generated, a screenshot will be taken, and the file will be sent to the Steam Community page for the user.

No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here