s&box HUD: UI scale factor
HUD Static Class HUD is an internal static class that provides a scale factor for UI elements based on screen resolution. It ensures UI elements scale proportio…
WorldPanel and ScreenPanel — HUD overlays and 3D world-space UI with Razor PanelComponent
WorldPanel and ScreenPanel — UI in the World s&box UI uses (Razor) attached to either a (HUD overlay) or (3D world-space UI). The same component works with both…
HudPainter: Immediate-Mode HUD Drawing in s&box
Each has a property (HudPainter) for immediate-mode drawing onto the screen. More efficient than UI panels since there's no layout, stylesheets, or interactivit…
Player Component with Static Accessors
Player Component Main player component that manages health, damage, camera, and interfaces with the inventory system. Static Accessors Key Properties HUD Visibi…
Sandbox: ToolMode system — creating custom Tool Gun modes
ToolMode System — Creating Custom Tool Gun Modes is the base class for all Tool Gun tools in Sandbox. Tools are components on the Toolgun and are enabled/disabl…
BaseWeapon and BaseCarryable Weapon Framework
BaseWeapon and BaseCarryable - Weapon Framework Base classes for creating weapons in s&box. Provides ammo management, view/world models, and input handling. Bas…
Localization (i18n)
Localization (i18n) Support multiple languages using localization tokens. How It Works Use tokens starting with in UI strings. The system replaces them based on…
Performance Best Practices
s&box Performance Best Practices Community guide for writing performant s&box code based on engine behavior and developer recommendations. Object Pooling Avoid …
s&box IToolInfo: Tool information display interface
IToolInfo API Reference IToolInfo is an interface for providing tool information display in the UI, such as in the spawn menu or tool selector. Type Signature P…
s&box built-in component quick reference — rendering, physics, navigation, UI, and audio
s&box Component Quick Reference A cheat sheet of the most commonly used built-in components and what they do. Rendering Lighting Physics Navigation UI Audio Gam…
s&box AmmoResource: Shared ammo type GameResource
AmmoResource GameResource API Reference AmmoResource is a GameResource that defines a type of ammo that can be shared across weapons. Weapons that reference the…
Razor Panels - s&box Documentation
Official s&box documentation for Razor Panels - the UI layout system. Razor Panels use a familiar HTML-like syntax with C# code-behind for building game interfa…
ScreenPanel and WorldPanel: AutoScale Strategies, ZIndex, LookAtCamera, and Interaction Range
ScreenPanel and WorldPanel: UI Components in s&box Scenes ScreenPanel is the root component for 2D screen-space UI. It renders attached children to the screen. …
RenderOptions: Game, Overlay, Bloom, AfterUI Render Layers — and Renderer.Attributes for Shader Parameters
RenderOptions: Render Layers for SceneObjects controls which render layers a component's appears in. It's exposed as a property on all subclasses. Render Layers…
s&box ISpawner: Spawner interface
ISpawner Interface API Reference ISpawner describes something that can be spawned into the world. Implementations handle their own preview rendering and spawn l…
Building a Networked Radio System with 3D Audio and Sync
Building a functional, interactive, and multiplayer-compatible radio system in s&box requires coordinating networked replication, local 3D audio handles, extern…
BuildHash pattern for Razor panel optimization
BuildHash Pattern for Razor Panel Optimization BuildHash is a method you can override in Razor panels to prevent unnecessary rebuilds when the underlying state …
Chat UI Pattern with RPC Broadcasting
Chat UI with RPC Broadcasting A Razor UI component for game chat that handles local input, RPC broadcasting, Steam filtering, and automatic message expiration. …
Nameplate Component with Voice Activity
Nameplate with Voice Activity A Razor component that displays player nameplates above characters with voice chat visualization. Implementation SCSS Example Key …
ToolMode Base Class for Toolgun Modes
ToolMode Base Class Abstract base class for creating toolgun modes in s&box. Handles input registration, action dispatch, and HUD rendering. Class Overview Acti…