Skip to content

Screenshots

Functions for adding screenshots to the user's screenshot library. See Steam Screenshots for more information.

Only available in the main GodotSteam branches

Functions

addScreenshotToLibrary

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: uint32_t

  • Returns 0 if the screenshot could not be saved.

Read more in the official Steamworks SDK documentation

addVRScreenshotToLibrary

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: uint32_t


Read more in the official Steamworks SDK documentation

hookScreenshots

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. Then the game is expected to call writeScreenshot or addScreenshotToLibrary in response.

You can check if hooking is enabled with isScreenshotsHooked.

Returns: void


Read more in the official Steamworks SDK documentation

isScreenshotsHooked

isScreenshotsHooked()

Checks if the app is hooking screenshots.

Returns: bool


Read more in the official Steamworks SDK documentation

setLocation

setLocation( uint32_t screenshot, string location )

Sets optional metadata about a screenshot's location.

Returns: bool


Read more in the official Steamworks SDK documentation

tagPublishedFile

tagPublishedFile( uint32_t screenshot, uint64_t file_id )

Tags a published file as being visible in the screenshot.

Returns: bool


Read more in the official Steamworks SDK documentation

tagUser

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 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, AddVRScreenshotToLibrary calls.

Returns: bool


Read more in the official Steamworks SDK documentation

triggerScreenshot

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.

Triggers a screenshot_ready callback.

Returns: void


Read more in the official Steamworks SDK documentation

writeScreenshot

writeScreenshot( PoolByteArray rgb, int width, int height )

Writes a screenshot to the user's Steam screenshot library.

Triggers a screenshot_ready callback.

Returns: uint32_t


Read more in the official Steamworks SDK documentation

Signals

These callbacks require you to run Steam.run_callbacks() in your _process() function to receive them.

screenshot_ready

screenshot_ready

A screenshot successfully written or otherwise added to the library and can now be tagged.

Returns:

  • handle (uint32_t)
  • result (uint32_t)

Read more in the official Steamworks SDK documentation

screenshot_requested

screenshot_requested

A screenshot has been requested by the user from the Steam screenshot hotkey. This will only be called if hookScreenshots has been enabled, in which case Steam will not take the screenshot itself.

Returns: nothing


Read more in the official Steamworks SDK documentation

Enums

VRScreenshotType

Enumerator Value
VR_SCREENSHOT_TYPE_NONE 0
VR_SCREENSHOT_TYPE_MONO 1
VR_SCREENSHOT_TYPE_STEREO 2
VR_SCREENSHOT_TYPE_MONO_CUBE_MAP 3
VR_SCREENSHOT_TYPE_MONO_PANORAMA 4
VR_SCREENSHOT_TYPE_STEREO_PANORAMA 5