Steamworks 文獻庫
Steam 內嵌介面

概覽

Steam 內嵌介面是 Steam 使用者介面的一部分,使用時可覆蓋於幾乎任何 Steam 遊戲之上。 使用者可通過介面開啟好友名單、網頁瀏覽器、聊天,和遊戲內 DLC 購買。

在遊戲中開啟內嵌介面的預設鍵是 SHIFT + TAB,但可在 Steam 設定中變更。

需求

您的遊戲不須任何特別的設置即可使用內嵌介面,它會自動掛勾任何從 Steam 開啟的遊戲! 開發期間,於偵錯工具執行遊戲時,呼叫 SteamAPI_Init 即會載入內嵌介面。 所以必須在初始化 OpenGL/D3D 裝置前先呼叫 SteamAPI_Init,不然便無法與裝置掛鉤。

內嵌介面支援使用 DirectX 7 - 12、OpenGL、Metal,和 Vulkan 的應用程式。 在軟體模擬轉譯(Software-Rasterize)的遊戲中無法使用內嵌介面。

macOS: Overlay support for 10.15 (Catalina) requires adding entitlements to your build configuration. Details are provided on the platforms page.
NOTE: The overlay is automatically disabled for 'Software' app types. If you need the overlay enabled, you can do so by:
  • Making sure your Steam account has the Edit App Metadata permission
  • Navigate from the App's landing page to > Edit Steamworks Settings > Installation tab > General Installation
  • Check box for Enable Steam Overlay for Application
  • Publish

在應用程式中開啟內嵌介面

There are a set of functions in the Steamworks API that give you direct access to triggering the game overlay.

內嵌介面向遊戲的通訊

The following signals (callbacks) are sent from Steam to your game, based on user action in the overlay:

常見問答

備註: You may find additional answers on the customer facing support site such as this topic: Steam Community Overlay does not Activate.

問: 為什麼 Steam 內嵌介面會使得我的應用程式當機?

答: The Steam overlay is used in thousands of games and as such it has been very thoroughly tested and is rarely the cause of a crash. However, because of the way it injects itself into the game, it does often expose memory leaks or memory corruption in the usage of your rendering API that may not have impacted game play.

To diagnose overlay crashes with DirectX for example, try to determine how D3D got into a bad state by using the d3d debug runtime with all (info/warning/error/notice) level spew turned on. It might give some hints to orphaned d3d resources. If you don’t find anything that way there may be a more general memory corruption issue. If these always occur on shutdown then it’s likely a shutdown ordering issue with the game not cleaning up as it shuts down.

If after debugging the app is still crashing in the overlay, please notify us in the Steamworks Development Group.

問: 為什麼 Steam 內嵌介面沒有出現在我的應用程式中?

答: First ensure that you meet the 需求 above. If you do meet the requirements and it's still not showing up, make sure you're launching the app through the Steam client, either directly from the lobby/quick launch list, or by calling SteamAPI_RestartAppIfNecessary.

問: 我的遊戲使用 D12onWin7,但 Steam 內嵌介面無法運作。 怎麼會這樣?

答: Please refer to this Microsoft document on how to add Steam overlay support.