################# ISteamScreenshots ################# .. note:: This documentation is auto-generated. Methods marked with 🤖 are automatically generated bindings. Methods marked with ✍️ are manually implemented and methods marked with ✋ are currently not implemented. List of Functions ----------------- * :func:`Screenshots.AddScreenshotToLibrary` * :func:`Screenshots.AddVRScreenshotToLibrary` * :func:`Screenshots.HookScreenshots` * :func:`Screenshots.IsScreenshotsHooked` * :func:`Screenshots.SetLocation` * :func:`Screenshots.TagPublishedFile` * :func:`Screenshots.TagUser` * :func:`Screenshots.TriggerScreenshot` * :func:`Screenshots.WriteScreenshot` List of Callbacks ----------------- * :func:`Screenshots.OnScreenshotReady` * :func:`Screenshots.OnScreenshotRequested` Function Reference ------------------ .. function:: Screenshots.AddScreenshotToLibrary(pchFilename, pchThumbnailFilename, nWidth, nHeight) 🤖 **Auto-generated binding** :param str? pchFilename: :param str? pchThumbnailFilename: :param int nWidth: :param int nHeight: :returns: (int - ScreenshotHandle) Return value :SteamWorks: `AddScreenshotToLibrary `_ **Example**:: local handle = Steam.Screenshots.AddScreenshotToLibrary('screenshot.png', nil, 1920, 1080) if handle ~= 0 then Steam.Screenshots.SetLocation(handle, 'Main Menu') end .. function:: Screenshots.AddVRScreenshotToLibrary(eType, pchFilename, pchVRFilename) 🤖 **Auto-generated binding** :param int - EVRScreenshotType eType: :param str? pchFilename: :param str? pchVRFilename: :returns: (int - ScreenshotHandle) Return value :SteamWorks: `AddVRScreenshotToLibrary `_ .. function:: Screenshots.HookScreenshots(bHook) 🤖 **Auto-generated binding** :param bool bHook: :SteamWorks: `HookScreenshots `_ **Example**:: -- Intercept F12 screenshots to add game UI before saving Steam.Screenshots.HookScreenshots(true) .. function:: Screenshots.IsScreenshotsHooked() 🤖 **Auto-generated binding** :returns: (bool) Return value :SteamWorks: `IsScreenshotsHooked `_ .. function:: Screenshots.SetLocation(hScreenshot, pchLocation) 🤖 **Auto-generated binding** :param int - ScreenshotHandle hScreenshot: :param str? pchLocation: :returns: (bool) Return value :SteamWorks: `SetLocation `_ **Example**:: Steam.Screenshots.SetLocation(screenshotHandle, 'Boss Arena Level 5') .. function:: Screenshots.TagPublishedFile(hScreenshot, unPublishedFileID) 🤖 **Auto-generated binding** :param int - ScreenshotHandle hScreenshot: :param uint64 - PublishedFileId_t unPublishedFileID: :returns: (bool) Return value :SteamWorks: `TagPublishedFile `_ .. function:: Screenshots.TagUser(hScreenshot, steamID) 🤖 **Auto-generated binding** :param int - ScreenshotHandle hScreenshot: :param uint64 - CSteamID steamID: :returns: (bool) Return value :SteamWorks: `TagUser `_ .. function:: Screenshots.TriggerScreenshot() 🤖 **Auto-generated binding** :SteamWorks: `TriggerScreenshot `_ **Example**:: -- Programmatically take a Steam screenshot Steam.Screenshots.TriggerScreenshot() .. function:: Screenshots.WriteScreenshot(pubRGB, cubRGB, nWidth, nHeight) 🤖 **Auto-generated binding** :param str? pubRGB: :param int cubRGB: size of the input array ``pubRGB`` :param int nWidth: :param int nHeight: :returns: (int - ScreenshotHandle) Return value :SteamWorks: `WriteScreenshot `_ **Example**:: -- Capture the current framebuffer and add to Steam library local rgbData = captureFramebuffer() local handle = Steam.Screenshots.WriteScreenshot(rgbData, #rgbData, screenWidth, screenHeight) Callbacks --------- .. function:: Screenshots.OnScreenshotReady Callback for `ScreenshotReady_t `_ **callback(data)** receives: * **data.m_hLocal** *(int - ScreenshotHandle)* * **data.m_eResult** *(int - EResult)* **Example**:: function Steam.Screenshots.OnScreenshotReady(data) if data.m_eResult == Steam.k_EResultOK then print('Screenshot saved, handle:', data.m_hLocal) end end .. function:: Screenshots.OnScreenshotRequested Callback for `ScreenshotRequested_t `_ **callback(data)** receives no fields (notification only). **Example**:: function Steam.Screenshots.OnScreenshotRequested() -- User pressed F12; capture game state and submit local rgbData = captureFramebuffer() Steam.Screenshots.WriteScreenshot(rgbData, #rgbData, screenWidth, screenHeight) end