public static abstract sealed class Sandbox.Application
Related Guides
Broader workflow and conceptual references connected to this API.
If you are using HTTP requests or WebSockets in your game, you can use Auth Tokens to validate that the requests were sent from a valid Steam user in a s&box game session. This is useful if you want to tie data to a specific Steam account, or prevent botting.
When creating a Tool or Editor Project, it's common to want to be able to trigger certain actions with a key press or combined keystroke (Like O to enter Object Mode, or SHIFT+B to enter the Block Tool).
Whenever you save a code file in your project (.cs or .razor files), we recompile and attempt to live-reload the changed assembly. This lets you quickly iterate and see your changes without needing to restart the editor. Ideally we want to support this for 99% of code changes without you needing to think about what happens under the hood, but this document will help you investigate cases where things go wrong.
Properties
Showing 18 properties
public static ulong Sandbox.Application.AppId { get; set; }
Steam AppId of S&box.
public static bool Sandbox.Application.CheatsEnabled { get; set; }
public static Editor.EditorSystem Sandbox.Application.Editor { get; set; }
Get the current editor if any. Will return null if we're not in the editor, or there is no active editor session.
public static bool Sandbox.Application.IsConsoleApp { get; set; }
True if running in a terminal like console, instead of a game window or editor.
public static bool Sandbox.Application.IsDebug { get; set; }
public static bool Sandbox.Application.IsDedicatedServer { get; set; }
True if this is a dedicated server
public static bool Sandbox.Application.IsEditor { get; set; }
True if running with the tools or editor attached
public static bool Sandbox.Application.IsFocused { get; set; }
Is the game window in focus?
public static bool Sandbox.Application.IsHeadless { get; set; }
True if running without a graphics window, such as in a terminal.
public static bool Sandbox.Application.IsMicrophoneListening { get; set; }
Returns true if the microphone is currently listening
public static bool Sandbox.Application.IsMicrophoneRecording { get; set; }
Returns true if the microphone is currently listening and actually hearing/capturing sounds
public static bool Sandbox.Application.IsStandalone { get; set; }
True if the game is running in standalone mode
public static bool Sandbox.Application.IsUnitTest { get; set; }
True if we're running the engine as part of a unit test
public static bool Sandbox.Application.IsVR { get; set; }
True if the game is running in VR mode
public static string Sandbox.Application.LanguageCode { get; set; }
The language code for the current language
public static Sandbox.Engine.Settings.RenderSettings Sandbox.Application.RenderSettings { get; set; }
Allows access to the RenderSettings singleton, which contains settings related to rendering in the game. You're only able to access this when in standalone mode. When accessing in the editor, or in sbox it will return null.
public static string Sandbox.Application.Version { get; set; }
The engine's version string
public static System.DateTime Sandbox.Application.VersionDate { get; set; }
The date of this version, as a UTC datetime.
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.Application |