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 …
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…
Slot-based inventory UI with BuildHash optimization
Slot-Based Inventory UI with BuildHash Optimization This example shows a slot-based inventory UI with BuildHash() optimization to prevent unnecessary rebuilds a…
Collider Component: Triggers, Surface Properties, Keyframe Bodies, Concave Shapes, and Tag Propagation
Collider Component: Triggers, Surface Properties, and Keyframe Bodies The abstract base class is the foundation for all physics colliders in s&box (, , , , ). T…
Razor Panels: HTML/CSS UI with C# in s&box PanelComponent System
s&box Razor Panels use web-like HTML/CSS syntax with C# for UI creation. Panels are rendered natively (not via HTML renderer) — the syntax is a convenience laye…
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 …
PolygonMesh — procedural block meshes with per-face materials and vertex editing
PolygonMesh — Procedural Block Meshes s&box includes a API for creating and editing meshes at runtime or in editor tools. The editor's block mesh tools use this…
s&box Hotload System: How Code Reloading Works, SkipHotload, ConVar Persistence, and NetworkObject.OnHotload
s&box Hotload System: How Code Reloading Works s&box supports live code reloading (hotload) without restarting the game. Understanding how it works helps avoid …
Razor Panels: HTML/CSS UI with C# in s&box
s&box UI can be created using Razor syntax — web-like HTML/CSS combined with C#. Panels are not rendered via a HTML renderer; the syntax is a convenience layer …
s&box JSONObject Save Data Helper for Components
This s&box-focused sample shows how to programmatically construct and deconstruct JSON for component save data. It is useful for player saves, world unlock stat…
Scene Object Index: How Scene.GetAll Works — Type Hierarchy Indexing, Update Sets, and Hotload Safety
Scene Object Index: How Scene.GetAll<T> Works and Why It's Fast is the primary way to find all active components or systems of a type in the scene. Understandin…
VirtualGrid — efficiently rendering large scrollable lists in s&box UI
VirtualGrid — Efficiently Rendering Large Lists in UI is a s&box UI panel that virtualizes a large collection — only the visible cells are created in the DOM. S…
Drag-and-drop system with static instance pattern
Drag-and-Drop System with Static Instance Pattern This example shows a drag-and-drop system using a static instance pattern for global state management and visu…
Custom Editors - s&box Editor Documentation
Custom Editors Custom editors let you create specialized inspector interfaces for your components and assets. Build custom widgets, property drawers, and full i…
Extensible Player Data Save Hooks for World Components
This pattern lets gameplay components plug into a player's save/load flow without putting every feature directly inside one large class. The framework has three…
Navigation: Recast NavMesh Generation and Pathfinding in s&box
s&box implements Recast Navigation (the industry standard used in Unreal, Unity, and Godot) for navmesh generation and navigation agents. What is a NavMesh? A s…