auto_stories

s&box MCP Knowledgebase

Documentation, API references, code examples and community knowledge for s&box development.

library_books 595 entries menu_book 352 Documentation code 133 API Reference terminal 100 Code Example groups 10 Community
Results for "Hud" 21 results closeClear
menu_bookDocumentation
May 12, 2026

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…

terminalCode Example
May 5, 2026

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…

menu_bookDocumentation
May 20, 2026

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…

codeAPI Reference
May 3, 2026

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…

terminalCode Example
May 4, 2026

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…

terminalCode Example
May 3, 2026

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…

menu_bookDocumentation
May 3, 2026

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…

groupsCommunity
May 3, 2026

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 …

codeAPI Reference
May 12, 2026

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…

groupsCommunity
May 5, 2026

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…

codeAPI Reference
May 12, 2026

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…

menu_bookDocumentation
May 5, 2026

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…

menu_bookDocumentation
May 4, 2026

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. …

menu_bookDocumentation
May 4, 2026

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…

codeAPI Reference
May 12, 2026

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…

menu_bookDocumentation
Jun 16, 2026

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…

menu_bookDocumentation
May 12, 2026

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 …

terminalCode Example
May 3, 2026

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. …

terminalCode Example
May 3, 2026

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 …

codeAPI Reference
May 3, 2026

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…