Overlay.Client
Support us as a GitHub Sponsor and get instant access to all our assets, exclusive tools and assets, escalated support and issue tracking and our gratitude.
These articles are made possible by our GitHub Sponsors ... become a sponsor today!
using API = HeathenEngineering.SteamworksIntegration.API;
public static class API.Overlay
The whole of the overlay system is only accessible from the Client API as a result you will always be using the form:
API.Overlay.Client
The overlay interface provides simplified access to Steam's overlay features. The Steam Overlay can be used to show web pages, access friends lists, clans,
Called when the overlay activates or deactivates.
public static GameOverlayActivatedEvent EventGameOverlayActivated;
Handler takes the form of
void HandleEvent(bool activated)
{
//Do Work
}
Called when the user tries to join a different game server from there friends list while the game is running.
public static GameServerChangeRequestedEvent EventGameServerChangeRequested;
Handler takes the form of
void HandleEvent(string server, string password)
{
//Do Work
}
Called when the user tries to join a lobby from there friends list or from an invite while the game is running.
public static GameLobbyJoinRequestedEvent EventGameLobbyJoinRequested;
Handler takes the form of
void HandleEvent(LobbyData lobby, UserData friend)
{
//Do Work
}
Called when the user tries to join a game from their friends list or after a user accepts an invite by a friend with
userData.InviteToGame(connectString);
or API.Friends.Client.InviteUserToGame(user, connectString);
.This callback is made when joining a game. If the user is attempting to join a lobby, then the callback Game Lobby Join Requested will be made.
public static GameRichPresenceJoinRequestedEvent EventGameRichPresenceJoinRequested;
Handler takes the form of
void HandleEvent(UseerData friend, string connectionString)
{
//Do Work
}
True if the overlay feature is enabled for this user on this app
public static bool IsEnabled => get;
True if the overlay is currently open
public static bool IsShowing => get;
Can be set to adjust where the notificaiton position anchors from
public static ENotificationPosition NotificationPosition { get; set; }
Offset from the position anchor
public static Vector2Int NotificationInset { get; set; }
Open the overlay to the indicated target
//Open to a specific Steam dialog by name
public static void Activate(string dialog);
or
//Open to a specific Steam dialog by enum
public static void Activate(OverlayDialog dialog);
or
//Opens the overlay to an indicated app with the indicated "flags"
public static void Activate(AppData appID, EOverlayToStoreFlag flag);
or
//Opens the overlay to a specific dialog by name with context
public static void Activate(string dialog, CSteamID steamId);
or
//Opens the overlay to a specific dialog by enum with context
public static void Activate(FriendDialog dialog, CSteamID steamId)
Opens the invite dialog
//Invites will be regarding this lobby
public static void ActivateInviteDialog(LobbyData lobbyId);
or
//Invites will be regarding this connection string
public static void ActivateInviteDialog(string connectionString);
Opens the remote play invite dialog with respect to a given lobby
public static void ActivateRemotePlayInviteDialog(LobbyData lobbyId);
Opens the overlay to a given web page
public static void ActivateWebPage(string url);
You can check if the Overlay is enabled ... that is ... is the overlay feature turned on for this app for this user.
if(API.Overlay.Client.IsEnabled)
Debug.Log("yes it is");
else
Debug.Log("no it is not");
To check if the overlay is currently open you can use
if(API.Overlay.Client.IsShowing)
Debug.Log("yes it is");
else
Debug.Log("no it is not");
The notification pop up that shows when a user unlocks and achievement or when friends join or leave games can be configured to show in different areas of the screen.
API.Overlay.Client.NotificationPosition =
EnotificationPosition.k_EPositionTopRight;
API.Overlay.Client.NotificationInset = new Vector2Int(0,0);
You can activate the overlay in a number of ways.
API.Overlay.Client.Activate(dialog);
API.Overlay.Client.ActivateInviteDialog(lobbyId);
API.Overlay.Client.ActivateInviteDialog(connectionInfo);
API.Overlay.Client.ActivateRemotePlayInviteDialog(lobbyId);
API.Overlay.Client.Activate(appId, flag);
API.Overlay.Client.Activate(dialog, user);
API.Overlay.Client.ActivateWebPage(url);
Last modified 5mo ago