Facepunch.Steamworks Wiki

Steamworks.SteamScreenshots

Undocumented Parental Settings

Events

static event Action<Result> OnScreenshotFailed
A screenshot attempt failed
static event Action<Data.Screenshot> OnScreenshotReady
A screenshot successfully written or otherwise added to the library and can now be tagged.
static event Action OnScreenshotRequested
A screenshot has been requested by the user from the Steam screenshot hotkey. This will only be called if Hooked is true, in which case Steam will not take the screenshot itself.

Properties

static bool Hooked { get; set; }
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 ScreenshotRequested_t 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.

Methods

static Data.Screenshot? AddScreenshot( string filename, string thumbnail, int width, int height )
Adds a screenshot to the user's screenshot library from disk. If a thumbnail is provided, it must be 200 pixels wide and the same aspect ratio as the screenshot, otherwise a thumbnail will be generated if the user uploads the screenshot. The screenshots must be in either JPEG or TGA format. The return value is a handle that is valid for the duration of the game process and can be used to apply tags. JPEG, TGA, and PNG formats are supported.
static void TriggerScreenshot()
Causes the Steam overlay to take a screenshot. If screenshots are being hooked by the game then a ScreenshotRequested callback is sent back to the game instead.
static Data.Screenshot? WriteScreenshot( byte[] data, int width, int height )
Writes a screenshot to the user's screenshot library given the raw image data, which must be in RGB format. The return value is a handle that is valid for the duration of the game process and can be used to apply tags.