Functions | Screenshots

Here is a list of all the functions available in the GodotSteam module. The descriptions are pulled from the official Steamworks SDK documentation with modifications made to fit GodotSteam's implementation of the functions. Naturally, any GodotSteam-specific functions will be noted as such.


addScreenshotToLibrary( string filename, string thumbnail_filename, int width, int height )

  • Adds a screenshot to the user's Steam screenshot library from disk.
  • Triggers a screenshot_ready callback.
  • Returns an int. Returns a uint32_t.

addVRScreenshotToLibrary( int type, string filename, string vr_filename )

  • Adds a VR screenshot to the user's Steam screenshot library from disk in the supported type.
  • Triggers a screenshot_ready callback.
  • Returns an int. Returns a uint32_t.

hookScreenshots( bool hook )

  • Toggles whether the overlay handles screenshots when the user presses the screenshot hotkey, or if the game handles them.
  • Hooking is disabled by default, and only ever enabled if you do so with this function.
  • If the hooking is enabled, then the screenshot_requested callback will be sent if the user presses the hotkey or when triggerScreenshot is called, and then the game is expected to call writeScreenshot or addScreenshotToLibrary in response.
  • You can check if hooking is enabled with isScreenshotsHooked.
  • Returns nothing; void.

isScreenshotsHooked()

  • Checks if the app is hooking screenshots, or if the Steam Overlay is handling them.
  • This can be toggled with hookScreenshots.
  • Returns a bool.

setLocation( int screenshot, string location ) setLocation( uint32_t screenshot, string location )

  • Sets optional metadata about a screenshot's location. For example, the name of the map it was taken on.
  • You can get the handle to tag the screenshot once it has been successfully saved from the screenshot_ready callback or via the writeScreenshot, addScreenshotToLibrary, and addVRScreenshotToLibrary calls.
  • Returns a bool.

tagPublishedFile( int screenshot, int file_id ) tagPublishedFile( uint32_t screenshot, uint64_t file_id )

  • Tags a published file as being visible in the screenshot.
  • You can tag up to the value declared by k_nScreenshotMaxTaggedPublishedFiles (32) in a single screenshot. Tagging more items than that will just be discarded.
  • This function has a built in delay before saving the tag which allows you to call it repeatedly for each item.
  • You can get the handle to tag the screenshot once it has been successfully saved from the screenshot_ready callback or via the writeScreenshot, addScreenshotToLibrary, and addVRScreenshotToLibrary calls.
  • Returns a bool.

tagUser( int screenshot, int steam_id ) tagUser( uint32_t screenshot, uint64_t steam_id )

  • Tags a Steam user as being visible in the screenshot.
  • You can tag up to the value declared by k_nScreenshotMaxTaggedUsers (32) in a single screenshot. Tagging more users than that will just be discarded.
  • This function has a built in delay before saving the tag which allows you to call it repeatedly for each item.
  • You can get the handle to tag the screenshot once it has been successfully saved from the screenshot_ready callback or via the writeScreenshot, addScreenshotToLibrary, and addVRScreenshotToLibrary calls.
  • Returns a bool.

triggerScreenshot()

  • Either causes the Steam Overlay to take a screenshot, or tells your screenshot manager that a screenshot needs to be taken. Depending on the value of isScreenshotsHooked.
  • Triggers a screenshot_requested callback if hooking has been enabled with hookScreenshots when the screenshot has been saved and added to the library otherwise.
  • Triggers a screenshot_ready callback.
  • Returns nothing; void.

writeScreenshot( PoolByteArray data, int width, int height )

  • Writes a screenshot to the user's Steam screenshot library given the raw image data, which must be in RGB format.
  • Triggers a screenshot_ready callback.
  • Returns an int. Returns a uint32_t.