Api Overlay
class

Overlay

public class Overlay

Provides static methods for displaying various modal overlays in the game UI. The 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.

Constructors

Overlay()

Properties

Name Type Description
IsOpen Boolean Returns true if any overlay is open
IsPauseMenuOpen Boolean Returns true if the pause menu overlay is open

Methods

static Void ShowGameModal(String packageIdent)

Opens a modal for the specified game package

packageIdent
static Void ShowMapModal(String packageIdent)

Opens a modal for the specified map package

packageIdent
static Void ShowPackageModal(String ident)

Opens a modal for the specified package

ident
static Void ShowPackageModal(String ident, String page)

Opens a modal for the specified package on the specified page

ident
page
static Void ShowNewsModal(News newsitem)

Opens a modal for the news item

static Void ShowOrganizationModal(Organization org)

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

org
static Void ShowReviewModal(Package package)

Opens a modal to review the specified package

package
static Void ShowPackageSelector(String query, Action<Package> onSelect, Action<String> onFilterChanged = null)
static Void ShowFriendsList()
static Void ShowFriendsList(FriendsListModalOptions options)

Opens a modal that shows the user's friends list

options
static Void ShowServerList(ServerListConfig config)

Opens a modal that shows a list of active servers

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"

static Void ShowBinds()

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

static Void CreateGame(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.

static Void ShowPlayer(SteamId steamid, String page = )

View a selected user's profile

static Void ShowPlayerList()

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

static Void WorkshopPublish(WorkshopPublishOptions options)

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

static Void ShowPauseMenu()

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

static Void Close()

Closes the top overlay if one exists

static Void CloseAll(Boolean immediate = False)

Close all open overlays

immediate — If , will skip any outros

Examples

// Show a modal for a specific game package
             Game.Overlay.ShowGameModal("facepunch.sandbox");
            
             // Check if any overlay is currently open
             if (Game.Overlay.IsOpen)
             {
                 // Pause game logic or input
             }
Assembly: Sandbox.Engine Declaring Type: Game Full Name: Sandbox.Game.Overlay