s&box docs

public class Sandbox.Game.Overlay

Provides static methods for displaying various modal overlays in the game UI. The `Sandbox.Game.Overlay` class allows you to open modals for packages, maps, news, organizations, reviews, friends lists, server lists, settings, input bindings, and player profiles. It serves as a central point for invoking user interface overlays that interact with core game and community features.

Broader workflow and conceptual references connected to this API.

Constructors

Showing 1 constructors

Methods

Showing 20 methods

public static void Close()

Closes the top overlay if one exists

public static void CloseAll(bool immediate = False)

Close all open overlays

Parameters

  • immediate: If , will skip any outros Default: False

public static void CreateGame(Sandbox.Modals.CreateGameOptions options)

Opens a modal to create a game with a bunch of settings. We use this in the menu when you click "Create Game" and the game has options.

public static void ShowBinds()

Opens a modal that lets you view and rebind game input actions.

public static void ShowGameModal(string packageIdent)

Opens a modal for the specified game package

public static void ShowMapModal(string packageIdent)

Opens a modal for the specified map package

public static void ShowNewsModal(Sandbox.Services.News newsitem)

Opens a modal for the news item

public static void ShowOrganizationModal(Sandbox.Package.Organization org)

Opens a modal for the specified organization. This is most likely called from a Package - so get the organization from there.

public static void ShowPackageSelector(string query, System.Action`1<Sandbox.Package> onSelect, System.Action`1<string> onFilterChanged = null)

Parameters

  • onFilterChanged: Default: null

public static void ShowPauseMenu()

Opens the pause menu overlay. This is the same menu that appears when pressing ESC.

public static void ShowPlayer(Sandbox.SteamId steamid, string page)

View a selected user's profile

public static void ShowPlayerList()

Open a modal that shows a list of players currently in the game

public static void ShowReviewModal(Sandbox.Package package)

Opens a modal to review the specified package

public static void ShowServerList(Sandbox.Modals.ServerListConfig config)

Opens a modal that shows a list of active servers

public static void ShowSettingsModal(string page)

Opens a modal that lets you modify your settings Optionally, you can specify a page to open directly to: "keybinds", "video", "input", "audio", "game", "storage", "developer"

public static void WorkshopPublish(Sandbox.Modals.WorkshopPublishOptions options)

Open a modal that prompts the user to publish content to the workshop

Properties

Showing 2 properties

public bool Sandbox.Game.Overlay.IsOpen { get; set; }

Returns true if any overlay is open

public bool Sandbox.Game.Overlay.IsPauseMenuOpen { get; set; }

Returns true if the pause menu overlay is open

Metadata

FieldValue
Namespaceglobal
Typeclass
AssemblySandbox.Engine
Doc IDT:Sandbox.Game.Overlay

On this page

Constructorspublic Overlay()Methodspublic static System.Void Close()public static System.Void CloseAll(System.Boolean immediate = False)public static System.Void CreateGame(Sandbox.Modals.CreateGameOptions options)public static System.Void ShowBinds()public static System.Void ShowFriendsList()public static System.Void ShowFriendsList(Sandbox.Modals.FriendsListModalOptions options)public static System.Void ShowGameModal(System.String packageIdent)public static System.Void ShowMapModal(System.String packageIdent)public static System.Void ShowNewsModal(Sandbox.Services.News newsitem)public static System.Void ShowOrganizationModal(Sandbox.Package.Organization org)public static System.Void ShowPackageModal(System.String ident, System.String page)public static System.Void ShowPackageModal(System.String ident)public static System.Void ShowPackageSelector(System.String query, System.Action`1<Sandbox.Package> onSelect, System.Action`1<System.String> onFilterChanged = null)public static System.Void ShowPauseMenu()public static System.Void ShowPlayer(Sandbox.SteamId steamid, System.String page)public static System.Void ShowPlayerList()public static System.Void ShowReviewModal(Sandbox.Package package)public static System.Void ShowServerList(Sandbox.Modals.ServerListConfig config)public static System.Void ShowSettingsModal(System.String page)public static System.Void WorkshopPublish(Sandbox.Modals.WorkshopPublishOptions options)Propertiespublic System.Boolean Sandbox.Game.Overlay.IsOpen { get; set; }public System.Boolean Sandbox.Game.Overlay.IsPauseMenuOpen { get; set; }Metadata