Steamworks-dokumentation
Steam-overlay

Oversigt

Steam-overlayet er en del af Steam-brugergrænsefladen, som kan aktiveres oven på næsten ethvert spil, der startes via Steam. Det giver brugeren adgang til vennelisten, webbrowseren, chatten og til at købe DLC i spillet.

Standardgenvejstasten, som giver brugeren adgang til overlayet i et spil, er SHIFT+TAB, men brugeren kan ændre den i Steam -> dialogboksen "Indstillinger".

Krav

Dit spil behøver ikke at gøre noget særligt, for at overlayet fungerer. Det er automatisk tilgængeligt i spil, der startes fra Steam. Mens spillet er under udvikling, og du kører det i et fejlfindingsprogram, indlæses overlayet, når du kalder SteamAPI_Init. Som sådan skal du sørge for at kalde SteamAPI_Init, inden du initialiserer OpenGL/D3D-enheden. Ellers fungerer oprettelsen af enheden ikke.

Overlayet understøtter spil, der anvender DirectX 7-12, OpenGL, Metal og Vulkan. Overlayet vil ikke være aktivt i spil med softwarerasterisering.

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

Aktivering af overlayet fra din app

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

Kommunikation fra overlayet til dit spil

The following signals (callbacks) are sent from Steam to your game, based on user action in the overlay:
  • GameOverlayActivated_t
    Sendes, når spil-overlayet aktiveres eller deaktiveres. Spillet kan bruge dette til at pause eller genoptage singleplayer-spil.
  • GameServerChangeRequested_t
    Sendes, når brugeren vælger at tilslutte sig en vens spil. Indeholder detaljer om den spilserver, der skal tilsluttes til.
  • GameLobbyJoinRequested_t
    Sendes, når brugeren vælger at tilslutte sig en vens spil. Indeholder detaljer om den lobby, der skal tilsluttes til.

Ofte stillede spørgsmål

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

Sp. Hvorfor crasher Steam-overlayet min app?

Sv. 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.

Sp. Hvorfor vises Steam-overlayet ikke i min app?

Sv. First ensure that you meet the Krav 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.

Sp. Mit spil bruger D12onWin7, og Steam-overlayet fungerer ikke. Hvorfor?

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