Введение
Оверлей Steam — часть интерфейса, которая открывается поверх почти любой игры, запущенной в Steam. Она позволяет пользователю получить доступ к списку друзей, браузеру, чату и внутриигровым покупкам.
По умолчанию пользователи открывают оверлей в игре, нажав SHIFT+TAB, но они могут сменить это сочетание в настройках Steam.
Требования
В игре не нужно делать ничего специального, чтобы оверлей работал, он автоматически добавляется к любой игре, запущенной через Steam. Во время разработки или при запуске игры в отладчике оверлей загружается при вызове
SteamAPI_Init. Поэтому вам придётся вызвать
SteamAPI_Init до инициализации устройства OpenGL или D3D, в противном случае обработать создание устройства не удастся.
Оверлей поддерживает игры, которые используют DirectX версий с 7 по 12, OpenGL, Metal или Vulkan. В играх, использующих собственные интерфейсы растеризации, оверлей работать не будет.
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:
- GameOverlayActivated_t
Отправляется, когда оверлей открывается или закрывается. Это можно использовать для приостановки или возобновления игры в однопользовательских играх.
- GameServerChangeRequested_t
Отправляется, когда пользователь выбирает игру друга, чтобы подключиться к ней. Содержит описание игрового сервера.
- GameLobbyJoinRequested_t
Отправляется, когда пользователь выбирает игру друга, чтобы подключиться к ней. Содержит описание лобби.
Частые вопросы
Обратите внимание: You may find additional answers on the customer facing support site such as this topic:
Steam Community Overlay does not Activate.
В. Почему оверлей вызывает сбои в моём приложении?
О. 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.
В. Почему оверлей не открывается в моём приложении?
О. 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.
Q. My game is using D12onWin7, and the Steam overlay is not working. Why?
A. Please refer to this
Microsoft document on how to add Steam overlay support.