Overlay

The Steam overlay is a piece of the Steam user interface that can be activated over the top of almost any game launched through Steam. It lets the user access the friends list, web browser, chat, and in-game DLC purchasing.

The Steam overlay is not "in" your game; it is literally the Steam client (aka Steam.exe) rendering over the top of your game's main window. Consequently there is nothing to "debug" about Steam Overlay other than you requesting it to open to a particular dialogue correctly and that your game "pauses" when the overlay is open.

Development Time

Steam Overlay renders over the active window of whatever application initialised the SteamAPI. When you are developing and debugging "in editor", this will cause Steam to treat your editor as "the game". Unity, Unreal and most development tools have many windows, not one and as a result, the Steam Overlay will not work at all or will work unpredictably.

Examples

Is Active

To check if the Steam Overlay is currently open or to react to it opening

Code Free

Add the Overlay component to a GameObject and add the Overlay Activated event

C#

// Register the event On Game Overlay Activated
Overlay.Client.OnGameOverlayActivated.AddListener(HandleActivated);

// The handler will take the form
void HandleActrivated(bool IsShowing)
{
    if(IsShowing)
        ;// Pause your game?
    else
        ;// Unpause your game?
}

// Alternativly you can check
if (Overlay.Client.IsShowing)
    ; // Its showing

Open Dialogue

Used to open the overlay to a given dialog, Steam has a number of common dialogs you can open to

  • Friends

  • Community

  • Players

  • Settings

  • Offical Game Group

  • Stats

  • Achievements

Code Free

Add the Overlay component to a GameObject

And use the Open Dialog Name function to open the overlay to a specific dialogue

Typical dialog options include

  • friends

  • community

  • players

  • settings

  • officialgamegroup

  • stats

  • achievements

C#

// dialog is an enum of valid options.
Overlay.Client.Activate(dialog);

Open Invite

Can be used to invite a friend to a Game Session or a Lobby.

Steam Lobby is not a game server or a game session it is more akin to a chat room or "Discord DM" where you invite friends to for matchmaking or "party/group" purposes.

In contrast inviting a friend to a "Game" aka "Game Session" means to invite them to join a Listen Server (aka P2P Host) or Dedicated Server.

Code Free

Add the Overlay component to a GameObject

To open the Lobby Invite dialog in the Overlay so the player can choose a friend to invite call Open Lobby Invite

To open the Game Invite dialog in the Overlay so the player can choose a friend to invite call Open Connect String Invite

C#

Use the Activate Invite Dialog function, you can pass in a

  • String This will be the connection string to a "Game" aka "Game Session" to join. For example if you wanted to invite the player to join you assuming you are a Listen Server you can pass in UserData.Me.id.ToString()

  • LobbyData This will be the lobby you want to invite the user to, note LobbyData is implicitly convertible to and from ulong, uint and CSteamID so you can use a variable of any of those types as long as its a legitimate Steam Lobby.

Overlay.Client.ActivateInviteDialog(target);

Open Remote Play Together

Steam Remote Play feature allows a player to "Stream" the 2nd player to the game. That is the game will operate as if both players are local (couch coop).

Code Free

Add the Overlay component to a GameObject

Use the Open Remote Play Invite function providing it with the lobby you want to invite through.

C#

Overlay.Client.ActivateRemotePlayInviteDialog(lobby);

Open Store

You can open the Steam Overlay to the store of any given App ID. This is useful for directing players to your game from a demo, to DLC or to companion apps.

Code Free

Add the Overlay component to a GameObject

You can then use the

  • Open Store

  • Open Store Add to Cart

  • Open Store Add to Cart and Show

C#

Flag indicates

  • None

  • Add to Cart

  • Add to Cart and Show

Overlay.Client.Activate(appID, flag);

Open User Dialog

Code Free

Add the Overlay component to a GameObject

Each dialog has its own function as shown below, each takes a User component to indicate the user you want to open it for.

C#

// dialog is a string
// - steamid                :User Profile
// - chat                   :User Chat
// - jointrade              :Inventory trade dialog
// - stats                  :User Stats
// - achievements           :User Achievements
// - friendadd              :Add Friend dialog
// - friendremove           :Remove Friend dialog
// - friendrequestaccept    :Accept friend request
// - friendrequestignore    :Ignore friend reqeust
API.Overlay.Client.Activate(dialog, steamId);

Open Web

Code Free

Add the Overlay component to a GameObject

You can use the Open Web Page function to open the overlay to a specific web page

C#

Overlay.Client.ActivateWebPage(url);

Last updated