### StartDistance Property Source: https://sbox.game/api/Sandbox.Rendering.GradientFogSetup/StartDistance Allows getting and setting the start distance of the fog. ```APIDOC ## StartDistance ### Description Start distance of the fog. ### Property - **StartDistance** (float) - Read/Write ### Declaration Declared in Sandbox.Rendering.GradientFogSetup ``` -------------------------------- ### Size Property Source: https://sbox.game/api/Sandbox.RenderTextureAsset/Size Gets or sets the resolution of the render target in pixels. ```APIDOC ## Size Resolution of the render target in pixels. ### Property `Vector2Int Size { get; set; }` Declared in Sandbox.RenderTextureAsset · Assembly `Sandbox.Engine` ``` -------------------------------- ### SetupLighting Source: https://sbox.game/api/Sandbox.Graphics/SetupLighting Sets up the lighting attributes for the current object and places them in the targetAttributes. ```APIDOC ## SetupLighting ### Description Sets up the lighting attributes for the current object and places them in the targetAttributes. ### Method Signature `static void SetupLighting (SceneObject obj, RenderAttributes targetAttributes = null)` ### Parameters #### Path Parameters - **obj** (SceneObject) - Description not provided. - **targetAttributes** (RenderAttributes) - Optional. Defaults to null. Description not provided. ### Declared in Sandbox.Graphics · Assembly `Sandbox.Engine` ``` -------------------------------- ### Instantiate and Use Logger Source: https://sbox.game/api/Sandbox.Diagnostics.Logger Demonstrates how to use the default game logger and instantiate a custom logger with a specific name. Ensure the 'Trace Logging' option is enabled in the Help menu to view LogLevel.Trace messages. ```csharp using Sandbox; using Sandbox.Diagnostics; public class LoggerExample { // ConCmd executed via the console command "logger_example" [ConCmd("logger_example")] public static void ConCmdInstantiatedLoggerExample() { // The default (GameMenu) logger accessible via Log.Info, Log.Warning, Log.Error, etc. Log.Info("Info"); Log.Warning("Warning"); Log.Error("Error"); // You can also instantiate a Logger with a custom name. var myLogger = new Logger("MyLogger"); myLogger.Info("Info"); myLogger.Warning("Warning"); myLogger.Error("Error"); } } ``` -------------------------------- ### Accessing Random Color Property Source: https://sbox.game/api/Color/Random Use this static property to get a random color from the available presets. No setup or imports are required as it's a static member of the Color class. ```csharp static Color Random { get; set; } ``` -------------------------------- ### PhysicsTraceBuilder FromTo Method Source: https://sbox.game/api/Sandbox.PhysicsTraceBuilder/FromTo Overloads the FromTo method to set the start and end positions for a physics trace. ```APIDOC ## PhysicsTraceBuilder FromTo (Vector3 from, Vector3 to) ### Description Sets the start and end positions of the trace request. ### Parameters #### Path Parameters - **from** (Vector3) - Required - The starting position of the trace. - **to** (Vector3) - Required - The ending position of the trace. ### Returns - **PhysicsTraceBuilder** - The updated PhysicsTraceBuilder instance. ``` -------------------------------- ### Get and Set Viewport Size Source: https://sbox.game/api/Sandbox.Graphics/Viewport Access the static Viewport property to get or set the rendering dimensions. This property is declared in the Sandbox.Graphics assembly. ```csharp static Rect Viewport { get; set; } ``` -------------------------------- ### ParticleSystem() Source: https://sbox.game/api/Sandbox.ParticleSystem/.ctor Initializes a new instance of the ParticleSystem class with default settings. ```APIDOC ## ParticleSystem() ### Description Creates a new ParticleSystem with default parameters. ### Method constructor ### Signature void ParticleSystem () ### Remarks Declared in Sandbox.ParticleSystem ``` -------------------------------- ### GetTypeIdent Source: https://sbox.game/api/Sandbox.Internal.TypeLibrary/GetTypeIdent Gets the hash of a given type. ```APIDOC ## GetTypeIdent ### Description Get hash of a type. ### Method Signature int GetTypeIdent (System.Type type) ### Parameters #### Path Parameters - **type** (System.Type) - Description: ### Returns #### Success Response - **int** - Description: Declared in Sandbox.Internal.TypeLibrary · Assembly `Sandbox.Reflection` ``` -------------------------------- ### IconSetup Struct Source: https://sbox.game/api/i/allstructs Struct for setting up icons. ```csharp struct IconSetup ``` -------------------------------- ### Get Method Source: https://sbox.game/api/Sandbox.CookieContainer/Get Loads JSON encodable data from cookies using a specified key. If the key is not found, a fallback value is returned. ```APIDOC ## Get ### Description Loads JSON encodable data from cookies. ### Method T Get (string key, T fallback) ### Parameters #### Path Parameters - **key** (string) - Description: The key to look up in the cookies. - **fallback** (T) - Description: The value to return if the key is not found. ### Returns - **T** - The JSON encodable data associated with the key, or the fallback value. ``` -------------------------------- ### Preload Method Source: https://sbox.game/api/Sandbox.SoundFile/Preload Initiates the preloading of sound files. This method is part of the Sandbox.SoundFile class and is declared in the Sandbox.Engine assembly. ```APIDOC ## Preload() ### Description Initiates the preloading of sound files. ### Method void ### Signature void Preload() ### Declared In Sandbox.SoundFile in Assembly `Sandbox.Engine` ``` -------------------------------- ### Rotation.y Source: https://sbox.game/api/Rotation/y Gets or sets the Y component of this rotation. ```APIDOC ## Rotation.y ### Description Gets or sets the Y component of this rotation. ### Property `float y { get; set; }` ### Declared in Rotation · Assembly `Sandbox.System` ``` -------------------------------- ### Vector2.x Source: https://sbox.game/api/Vector2/x Gets or sets the X component of this vector. ```APIDOC ## Vector2.x ### Description Gets or sets the X component of this vector. ### Property - **x** (float) - The X component of the vector. ### Accessors - **get** - **set** ### Declared in Vector2 · Assembly `Sandbox.System` ``` -------------------------------- ### RunAll Source: https://sbox.game/api/Sandbox.PhysicsTraceBuilder/RunAll Executes the physics trace and returns all hits. ```APIDOC ## RunAll ### Description Run the trace and return all hits as a result. ### Method Sandbox.PhysicsTraceBuilder.RunAll() ### Returns Type| Description ---|--- Sandbox.PhysicsTraceResult[] | ``` -------------------------------- ### RenderAttributes Example Source: https://sbox.game/api/i/graphics Accessing attributes in a shader by binding them to variables. Ensure the attribute names match those set in the C# code. ```hlsl float4 CornerRadius < Attribute( "BorderRadius" ); >; Texture2D g_tColor < Attribute( "Texture" ); SrgbRead( false ); >; ``` -------------------------------- ### Apply Method Source: https://sbox.game/api/Sandbox.Engine.Settings.RenderSettings/Apply Applies the current render settings. ```APIDOC ## Apply Method ### Description Applies the current render settings. ### Method Signature `void Apply ()` ### Declared In Sandbox.Engine.Settings.RenderSettings ``` -------------------------------- ### Vector2.y Property Source: https://sbox.game/api/Vector2/y Gets or sets the Y component of this vector. ```APIDOC ## Vector2.y Property ### Description Gets or sets the Y component of this vector. ### Property Type `float` ### Access `get; set;` ### Declared in `Vector2` in assembly `Sandbox.System` ``` -------------------------------- ### Initialize Source: https://sbox.game/api/Sandbox.GpuBuffer/Initialize Initializes a GPU buffer with a specified number of elements, element size, usage flags, and an optional debug name. ```APIDOC ## Initialize ### Description Initializes a GPU buffer with the specified element count, element size, usage flags, and an optional debug name. ### Method `void Initialize(int elementCount, int elementSize, UsageFlags usageFlags, string debugName)` ### Parameters #### Parameters - **elementCount** (int) - The number of elements in the buffer. - **elementSize** (int) - The size of each element in bytes. - **usageFlags** (UsageFlags) - Flags specifying the buffer's usage (defaults to 32). - **debugName** (string) - An optional name for debugging purposes (defaults to null). ``` -------------------------------- ### Rotation.x Source: https://sbox.game/api/Rotation/x Gets or sets the X component of this rotation. ```APIDOC ## Rotation.x ### Description Gets or sets the X component of this rotation. ### Property - **x** (float) - Required - The X component of the rotation. ### Declared in Rotation · Assembly `Sandbox.System` ``` -------------------------------- ### Ray.Position Source: https://sbox.game/api/Ray/Position Gets or sets the origin position of the ray. ```APIDOC ## Ray.Position ### Description Gets or sets the origin position of the ray. This property is of type Vector3. ### Property - **Position** (Vector3) - Gets or sets the origin of the ray. ### Declared in Ray · Assembly `Sandbox.System` ``` -------------------------------- ### Run Source: https://sbox.game/api/Sandbox.PhysicsTraceBuilder/Run Run the trace and return the result. The result will return the first hit. ```APIDOC ## Run ### Description Run the trace and return the result. The result will return the first hit. ### Method PhysicsTraceResult Run () ### Returns Type| Description ---|--- PhysicsTraceResult | Declared in Sandbox.PhysicsTraceBuilder · Assembly `Sandbox.Engine` ``` -------------------------------- ### Ray.Forward Source: https://sbox.game/api/Ray/Forward Gets or sets the direction of the ray as a Vector3. ```APIDOC ## Ray.Forward ### Description Gets or sets the direction of the ray. ### Property - **Forward** (Vector3) - The direction of the ray. ``` -------------------------------- ### FromOgg Method Source: https://sbox.game/api/Sandbox.SoundFile/FromOgg Loads a SoundFile from an Ogg filename and byte data, with optional loading options. ```APIDOC ## FromOgg Method ### Description Loads a SoundFile from an Ogg filename and byte data, with optional loading options. ### Signature `static SoundFile FromOgg (string filename, System.Span data, LoadOptions options = null)` ### Parameters #### Path Parameters - **filename** (string) - Description: The name of the Ogg file. - **data** (System.Span) - Description: The byte data of the Ogg file. - **options** (LoadOptions) - Optional - Description: Loading options for the sound file. ### Returns - **SoundFile** - Description: The loaded SoundFile object. ``` -------------------------------- ### SoundFile.FromWav Source: https://sbox.game/api/Sandbox.SoundFile/FromWav Creates a SoundFile instance from WAV data. ```APIDOC ## SoundFile.FromWav ### Description Loads audio data from a WAV file specified by its filename and byte data. ### Method static ### Signature static SoundFile FromWav(string filename, System.Span data, LoadOptions options = null) ### Parameters #### Parameters - **filename** (string) - The name of the WAV file. - **data** (System.Span) - The raw byte data of the WAV file. - **options** (LoadOptions) - Optional load options. Defaults to null. ### Returns - **SoundFile** - A SoundFile object representing the loaded audio data. ``` -------------------------------- ### Angles.Forward Source: https://sbox.game/api/Angles Gets the forward direction vector for this angle. ```APIDOC ## Angles.Forward ### Description Gets the forward direction vector for this angle. ### Returns - **Vector3** - The forward direction vector. ``` -------------------------------- ### Color Constructor Source: https://sbox.game/api/Color/.ctor Initializes a color with each component set to given values, in the range [0,1]. ```APIDOC ## Color Constructor ### Description Initializes a color with each component set to given values, in range [0,1]. ### Method Signature `void Color(float r, float g, float b, float a)` ### Parameters #### Parameters - **r** (float) - The red component of the color. - **g** (float) - The green component of the color. - **b** (float) - The blue component of the color. - **a** (float) - The alpha (transparency) component of the color. Defaults to 1. ``` -------------------------------- ### GetVector4 Source: https://sbox.game/api/Sandbox.RenderAttributes/GetVector4 Get a vector4 value - else defaultValue if missing. ```APIDOC ## GetVector4 ### Description Retrieves a Vector4 value associated with the given name. If the value is not found, the provided defaultValue is returned. ### Method Signature Vector4 GetVector4 (in StringToken name, in Vector4 defaultValue) ### Parameters #### Path Parameters - **name** (StringToken) - Required - The name of the Vector4 value to retrieve. - **defaultValue** (Vector4) - Optional - The value to return if the named Vector4 is not found. Defaults to null if not provided. ### Returns - **Vector4** - The retrieved Vector4 value or the defaultValue if not found. ``` -------------------------------- ### Rotation.Left Source: https://sbox.game/api/Rotation/Left Gets or sets the left hand direction of this rotation. ```APIDOC ## Rotation.Left ### Description Gets or sets the left hand direction of this rotation. ### Property Vector3 Left { get; set; } ``` -------------------------------- ### Material.Create Source: https://sbox.game/api/Sandbox.Material/Create Creates a new empty material at runtime. ```APIDOC ## Material.Create ### Description Creates a new empty material at runtime. ### Method static Material Create (string materialName, string shader, bool anonymous) ### Parameters #### Path Parameters - **materialName** (string) - Required - Name of the new material. - **shader** (string) - Required - Shader that the new material will use. - **anonymous** (bool) - Optional - If false, material can be found by name. Defaults to true. ### Returns #### Success Response - **Material** - The new material. ``` -------------------------------- ### GetAnimationIndex Source: https://sbox.game/api/Sandbox.Sprite/GetAnimationIndex Gets the index of an animation by its name. Returns -1 if not found. ```APIDOC ## GetAnimationIndex ### Description Gets the index of an animation by its name. Returns -1 if not found. ### Method int GetAnimationIndex (string name) ### Parameters #### Path Parameters - **name** (string) - Required - The name of the animation ### Returns #### Success Response - **int** - The index of the animation, or -1 if not found. ``` -------------------------------- ### PcmOptions Constructor Source: https://sbox.game/api/Sandbox.SoundFile.PcmOptions Initializes a new instance of the PcmOptions struct with default values. ```APIDOC ## PcmOptions (Constructor) ### Description Initializes a new instance of the PcmOptions struct. This is used to configure options for creating a sound from raw PCM data via Sandbox.SoundFile.FromPcm. ### Method Constructor ### Parameters None ``` -------------------------------- ### CommandList Constructor Source: https://sbox.game/api/Sandbox.Rendering.CommandList/.ctor Initializes a new instance of the CommandList class. ```APIDOC ## void CommandList () ### Description Initializes a new instance of the CommandList class. ### Method Constructor ### Parameters This constructor does not take any parameters. ### Response Initializes a new CommandList object. ``` -------------------------------- ### CreateGameOptions Struct for Modals Source: https://sbox.game/api/i/allstructs Options passed to IModalSystem.CreateGame. ```csharp struct CreateGameOptions ``` -------------------------------- ### ShaderName Property Source: https://sbox.game/api/Sandbox.Material/ShaderName Gets or sets the underlying shader name for this material. ```APIDOC ## ShaderName ### Description Gets the underlying shader name for this material. ### Property `string ShaderName { get; set; }` ### Declared in Sandbox.Material · Assembly `Sandbox.Engine` ``` -------------------------------- ### WorkshopPublishOptions Struct for Modals Source: https://sbox.game/api/i/allstructs Options passed to IModalSystem.WorkshopPublish. ```csharp struct WorkshopPublishOptions ``` -------------------------------- ### AntiAliasQuality Source: https://sbox.game/api/Sandbox.Engine.Settings.RenderSettings/AntiAliasQuality Gets or sets the anti-aliasing quality. The type of this property is MultisampleAmount. ```APIDOC ## AntiAliasQuality ### Description Gets or sets the anti-aliasing quality. ### Property `MultisampleAmount AntiAliasQuality { get; set; }` ### Declared in Sandbox.Engine.Settings.RenderSettings ``` -------------------------------- ### BenchmarkTestSummary Struct for Modals Source: https://sbox.game/api/i/allstructs Display-ready summary of a single benchmark test, passed to IModalSystem.BenchmarkResults. ```csharp struct BenchmarkTestSummary ``` -------------------------------- ### TileSize Property Source: https://sbox.game/api/Sandbox.Clutter.ClutterDefinition/TileSize Gets or sets the tile size as a float value. ```APIDOC ## TileSize Property ### Description Gets or sets the tile size as a float value. ### Property `float TileSize { get; set; }` ### Declared in Sandbox.Clutter.ClutterDefinition ``` -------------------------------- ### Rotation.Up Source: https://sbox.game/api/Rotation/Up Gets or sets the upwards direction of this rotation. This is a Vector3 property. ```APIDOC ## Rotation.Up ### Description Gets or sets the upwards direction of this rotation. ### Property - **Up** (Vector3) - Gets or sets the upwards direction. ``` -------------------------------- ### PropertyFinishEditDelegate Constructor Source: https://sbox.game/api/Sandbox.SerializedObject.PropertyFinishEditDelegate Constructor for PropertyFinishEditDelegate. It takes an object and a method as parameters. ```APIDOC ## PropertyFinishEditDelegate Constructor ### Description Initializes a new instance of the `PropertyFinishEditDelegate` class. ### Parameters - **object** (object) - An object. - **method** (method) - A method. ``` -------------------------------- ### SoundFile.FromMp3 Source: https://sbox.game/api/Sandbox.SoundFile/FromMp3 Creates a SoundFile object from MP3 data using a filename, a span of bytes, and optional load options. ```APIDOC ## SoundFile.FromMp3 ### Description Creates a SoundFile object from MP3 data. ### Method static ### Signature static SoundFile FromMp3 (string filename, System.Span data, LoadOptions options = null) ### Parameters #### Path Parameters - **filename** (string) - Description: - **data** (System.Span) - Description: #### Query Parameters - **options** (LoadOptions) - Optional - Description: Defaults to null. ### Returns - **SoundFile** - Description: ``` -------------------------------- ### Rotation.Right Source: https://sbox.game/api/Rotation/Right Gets or sets the right-hand direction of this rotation. This is a Vector3 property. ```APIDOC ## Rotation.Right ### Description Gets or sets the right-hand direction of this rotation. ### Property - **Right** (Vector3) - The right-hand direction vector. ``` -------------------------------- ### ToTexture Source: https://sbox.game/api/Sandbox.Bitmap/ToTexture Try to create a texture from this bitmap. ```APIDOC ## ToTexture ### Description Try to create a texture from this bitmap. ### Method Texture ToTexture (bool mips = True) ### Parameters #### Path Parameters - **mips** (bool) - Optional - Defaults to True. ### Returns - **Texture** - The created texture. ``` -------------------------------- ### Rotation.Forward Source: https://sbox.game/api/Rotation/Forward Gets or sets the forwards direction of this rotation. This is a Vector3 property. ```APIDOC ## Rotation.Forward ### Description Gets or sets the forwards direction of this rotation. ### Property - **Forward** (Vector3) - Gets or sets the forwards direction. ``` -------------------------------- ### Forward Property Source: https://sbox.game/api/Angles/Forward Gets or sets the forward direction vector for this angle. ```APIDOC ## Forward Property ### Description Gets or sets the forward direction vector for this angle. ### Signature Vector3 Forward { get; set; } ### Declared in Angles ``` -------------------------------- ### RenderTextureAsset Constructor Source: https://sbox.game/api/Sandbox.RenderTextureAsset/.ctor Initializes a new instance of the RenderTextureAsset class. ```APIDOC ## RenderTextureAsset() ### Description Initializes a new instance of the RenderTextureAsset class. ### Method constructor ### Signature void RenderTextureAsset () ### Declared in Sandbox.RenderTextureAsset ``` -------------------------------- ### PhysicsTraceBuilder Ray Source: https://sbox.game/api/Sandbox.PhysicsTraceBuilder/Ray Casts a ray from a starting point to an ending point. ```APIDOC ## PhysicsTraceBuilder Ray ### Description Casts a ray from point A to point B. ### Method Signature PhysicsTraceBuilder Ray (in Vector3 from, in Vector3 to) ### Parameters #### Path Parameters - **from** (Vector3) - Required - The starting point of the ray. - **to** (Vector3) - Required - The ending point of the ray. ### Returns - **PhysicsTraceBuilder** - The result of the physics trace. ``` -------------------------------- ### CreateWebSurface Source: https://sbox.game/api/Sandbox.Game/CreateWebSurface Creates a limited web surface. This method is static and does not require any parameters. ```APIDOC ## CreateWebSurface ### Description Creates a limited web surface. ### Method static ### Signature WebSurface CreateWebSurface () ### Returns - **WebSurface**: The created web surface object. ``` -------------------------------- ### ColorTarget Property Source: https://sbox.game/api/Sandbox.RenderTarget/ColorTarget This property allows getting and setting the target color texture. ```APIDOC ## ColorTarget Property ### Description Represents the target colour texture. ### Property `Texture ColorTarget { get; set; }` ### Declared in Sandbox.RenderTarget ``` -------------------------------- ### LoadAsync Method Source: https://sbox.game/api/Sandbox.SoundFile/LoadAsync Asynchronously loads a sound file. Returns a Task indicating success or failure. ```APIDOC ## LoadAsync ### Description Asynchronously loads a sound file. ### Method Task LoadAsync () ### Returns - **Task** - A task that represents the asynchronous operation. The task result is a boolean value indicating whether the sound file was loaded successfully. ``` -------------------------------- ### IsMultipleTargets Source: https://sbox.game/api/Sandbox.MultiSerializedObject/IsMultipleTargets Gets or sets a value indicating whether the target is multiple objects. ```APIDOC ## IsMultipleTargets ### Description True if the target is multiple objects. ### Property `bool IsMultipleTargets { get; set; }` ### Declared in `Sandbox.MultiSerializedObject` ``` -------------------------------- ### PrefabFile Load Source: https://sbox.game/api/Sandbox.PrefabFile/Load Loads a prefab from a specified file path. This method also supports custom path schemes like mount://. ```APIDOC ## PrefabFile Load ### Description Loads a prefab by file path. Also handles mount:// paths. ### Method static ### Signature PrefabFile Load (string path) ### Parameters #### Path Parameters - **path** (string) - Required - The file path to the prefab. Can include custom schemes like mount://. ``` -------------------------------- ### Get Game Ident Source: https://sbox.game/api/Sandbox.Game/Ident Retrieves the current game's unique identifier. ```APIDOC ## Get Game Ident ### Description Returns the current game's ident - ie facepunch.sandbox. ### Method GET ### Endpoint /game/ident ### Response #### Success Response (200) - **ident** (string) - The unique identifier of the game. ``` -------------------------------- ### SoundFile.FromPcm Source: https://sbox.game/api/Sandbox.SoundFile/FromPcm Creates a SoundFile from a filename, PCM data, and optional PcmOptions. ```APIDOC ## SoundFile.FromPcm ### Description Creates a SoundFile from a filename, PCM data, and optional PcmOptions. ### Method Signature `static SoundFile FromPcm (string filename, System.Span data, PcmOptions options = null)` ### Parameters #### Path Parameters - **filename** (string) - Description: The name of the file. - **data** (System.Span) - Description: The raw PCM data. - **options** (PcmOptions) - Optional - Description: Options for PCM decoding. Defaults to null. ### Returns - **SoundFile** - Description: The created SoundFile object. ``` -------------------------------- ### Vector2.Degrees Source: https://sbox.game/api/Vector2/Degrees Gets or sets the angle of this vector in degrees. The value is always between 0 and 360. ```APIDOC ## Property: Vector2.Degrees ### Description Returns the angle of this vector in degrees, always between 0 and 360. ### Type `float` ### Access `get; set;` ### Declared in `Vector2` · Assembly `Sandbox.System` ``` -------------------------------- ### PostLoad Source: https://sbox.game/api/Sandbox.GameResource/PostLoad This method is invoked automatically when a game resource is initially loaded from disk. It is part of the asset loading lifecycle. ```APIDOC ## PostLoad ### Description Called when the asset is first loaded from disk. ### Method void PostLoad () ### Declared in Sandbox.GameResource · Assembly `Sandbox.Engine` ``` -------------------------------- ### Color Constructors Source: https://sbox.game/api/Color Initializes a color with specified RGBA components. ```APIDOC ## Color (r, g, b, a) ### Description Initialize a color with each component set to given values, in range [0,1] ### Parameters - **r** (float) - Required - Red component in range [0,1] - **g** (float) - Required - Green component in range [0,1] - **b** (float) - Required - Blue component in range [0,1] - **a** (float) - Required - Alpha component in range [0,1] ``` -------------------------------- ### ColorIndex Property Source: https://sbox.game/api/Sandbox.Rendering.RenderTargetHandle/ColorIndex Gets or sets the reference to the index of the color texture of this render target. ```APIDOC ## ColorIndex ### Description Gets or sets the reference to the index of the color texture of this render target. ### Property `ColorIndexRef ColorIndex { get; set; }` ### Declared in Sandbox.Rendering.RenderTargetHandle ``` -------------------------------- ### Vector3 Constructors Source: https://sbox.game/api/Vector3 Initializes a new Vector3 instance with specified components. ```APIDOC ## Vector3 Constructor ### Description Initializes a vector with given components. ### Signature Vector3(x, y, z) ``` -------------------------------- ### Width Property Source: https://sbox.game/api/Sandbox.RenderTarget/Width Gets or sets the width of the render target. This property is of type integer. ```APIDOC ## Width Property ### Description Gets or sets the width of the render target. This property is of type integer. ### Property - **Width** (int) - Read/Write ### Declared in Sandbox.RenderTarget ``` -------------------------------- ### ColorHsv Constructor Source: https://sbox.game/api/ColorHsv Initializes a new HSV/HSB color. Hue is in the range of [0-360] and all other values are in range [0,1]. ```APIDOC ## ColorHsv (h, s, v, a) ### Description Initializes a new HSV/HSB color. ### Parameters #### Path Parameters - **h** (float) - Required - Hue component of this color in range 0 to 360. - **s** (float) - Required - Saturation of this color in range 0 (white) to 1 (full color). - **v** (float) - Required - Brightness of this color in range 0 (black) to 1 (full color). - **a** (float) - Required - Transparency of this color in range 0 (fully transparent) to 1 (fully opaque). ``` -------------------------------- ### Shader Property Access Source: https://sbox.game/api/Sandbox.Material/Shader Provides methods to get and set the shader associated with a material. ```APIDOC ## Shader Property ### Description Gets or sets the material's shader. ### Method Signature Shader Shader { get; set; } ### Declared In Sandbox.Material ``` -------------------------------- ### ElementCount Property Source: https://sbox.game/api/Sandbox.GpuBuffer/ElementCount Gets or sets the number of elements in the buffer. This property is of type int. ```APIDOC ## ElementCount ### Description Number of elements in the buffer. ### Property `int ElementCount { get; set; }` ### Declared in Sandbox.GpuBuffer ``` -------------------------------- ### ColorHsv Constructor Source: https://sbox.game/api/ColorHsv/.ctor Initializes a new HSV/HSB color. Hue is in the range of [0-360] and all other values are in range [0,1]. ```APIDOC ## ColorHsv Constructor ### Description Initializes a new HSV/HSB color. Hue is in the range of [0-360] and all other values are in range [0,1]. ### Method constructor ### Parameters #### Parameters - **h** (float) - Required - The hue color component. - **s** (float) - Required - Saturation of the color. - **v** (float) - Required - Brightness of the color. - **a** (float) - Optional - Alpha of the color. Defaults to 1. ``` -------------------------------- ### NoteStartEdit Source: https://sbox.game/api/Sandbox.SerializedObject/NoteStartEdit Initiates the editing process for a note, taking a SerializedProperty as input. ```APIDOC ## NoteStartEdit ### Description Initiates the editing process for a note. ### Method Signature `void NoteStartEdit(SerializedProperty childProperty)` ### Parameters #### Parameters - **childProperty** (SerializedProperty) - Description: None provided in source. ``` -------------------------------- ### Rotation Backward Property Source: https://sbox.game/api/Rotation/Backward Gets or sets the backwards direction of this rotation. This is a Vector3 property. ```APIDOC ## Rotation Backward Property ### Description Gets or sets the backwards direction of this rotation. ### Property `Vector3 Backward { get; set; }` ### Declared in Rotation · Assembly `Sandbox.System` ``` -------------------------------- ### Get Random Color Source: https://sbox.game/api/Color/Random Retrieves a random color from a set of 8 preset colors. ```APIDOC ## Get Random Color ### Description Returns a random color out of 8 preset colors. ### Method GET ### Endpoint /color/random ### Response #### Success Response (200) - **color** (string) - The name of the random color. ``` -------------------------------- ### SoundFile.Load Source: https://sbox.game/api/Sandbox.SoundFile/Load Loads a new sound file from disk. This method includes automatic caching for performance. ```APIDOC ## SoundFile.Load ### Description Loads a new sound file from disk. Includes automatic caching. ### Method static ### Signature SoundFile Load (string filename) ### Parameters #### Path Parameters - **filename** (string) - Required - The file path to load the sound from. ### Returns #### Success Response - **SoundFile** - The loaded sound file, or null if failed. ``` -------------------------------- ### PhysicsTraceBuilder Sphere Source: https://sbox.game/api/Sandbox.PhysicsTraceBuilder/Sphere Casts a sphere from a starting point to an ending point with a specified radius. ```APIDOC ## PhysicsTraceBuilder Sphere ### Description Casts a sphere from a starting point to an ending point with a specified radius. This method is part of the PhysicsTraceBuilder class. ### Method PhysicsTraceBuilder ### Parameters #### Path Parameters - **radius** (float) - Description: The radius of the sphere. - **from** (Vector3) - Required - Description: The starting point of the trace. - **to** (Vector3) - Required - Description: The ending point of the trace. ### Returns #### Success Response - **PhysicsTraceBuilder** - Description: Returns a PhysicsTraceBuilder object representing the sphere trace. ``` -------------------------------- ### Syncing a NetDictionary with Sandbox Source: https://sbox.game/api/i/allclasses Use NetDictionary with the SyncAttribute to synchronize dictionary data across the network. Only changes are sent, improving efficiency. Ensure you check `IsProxy` before modifying data on the client. ```csharp public class MyComponent : Component { [Sync] public NetDictionary MyBoolTable { get; set; } = new(); public void SetBoolState( string key, bool state ) { if ( IsProxy ) return; MyBoolTable[key] = state; } } ``` -------------------------------- ### BottomLeft Property Source: https://sbox.game/api/Sandbox.Rect/BottomLeft Gets or sets the position of the bottom left edge of this rect. This is a Vector2 property. ```APIDOC ## BottomLeft ### Description Position of the bottom left edge of this rect. ### Property Vector2 BottomLeft { get; set; } ### Declared in Sandbox.Rect · Assembly `Sandbox.System` ``` -------------------------------- ### Syncing a NetList with Sandbox Source: https://sbox.game/api/i/allclasses Utilize NetList with the SyncAttribute for network synchronization of list data. This method is efficient as it only transmits changes. Always verify `IsProxy` before client-side modifications. ```csharp public class MyComponent : Component { [Sync] public NetList MyIntegerList { get; set; } = new(); public void AddNumber( int number ) { if ( IsProxy ) return; MyIntegerList.Add( number ); } } ``` -------------------------------- ### PostLoad Method Source: https://sbox.game/api/Sandbox.PrefabFile/PostLoad The PostLoad method is part of the Sandbox.PrefabFile class and is declared in the Sandbox.Engine assembly. It is a void method, meaning it does not return any value. ```APIDOC ## PostLoad() ### Description This method is part of the Sandbox.PrefabFile class and is used for post-load operations. ### Method void ### Signature void PostLoad () ### Declared In Sandbox.PrefabFile · Assembly `Sandbox.Engine` ``` -------------------------------- ### VideoMemoryBudget Source: https://sbox.game/api/Sandbox.Graphics/VideoMemoryBudget Gets or sets the GPU video memory budget in bytes, as reported by the OS (WDDM). ```APIDOC ## VideoMemoryBudget ### Description Gets or sets the GPU video memory budget in bytes, as reported by the OS (WDDM). ### Property `static ulong VideoMemoryBudget { get; set; }` ### Declared in Sandbox.Graphics · Assembly `Sandbox.Engine` ``` -------------------------------- ### PhysicsGroupDescription.Load Source: https://sbox.game/api/Sandbox.PhysicsGroupDescription/Load Loads a Sandbox.PhysicsGroupDescription from a vphys resource path. ```APIDOC ## PhysicsGroupDescription.Load ### Description Loads a Sandbox.PhysicsGroupDescription from a vphys resource path. ### Method static PhysicsGroupDescription Load (string path) ### Parameters #### Path Parameters - **path** (string) - Required - The resource path to load the PhysicsGroupDescription from. ### Returns - **PhysicsGroupDescription** - The loaded PhysicsGroupDescription object. ``` -------------------------------- ### ElementSize Property Source: https://sbox.game/api/Sandbox.GpuBuffer/ElementSize Gets or sets the size of a single element in the buffer. This property is of type int. ```APIDOC ## ElementSize ### Description Size of a single element in the buffer. ### Property `int ElementSize { get; set; }` ### Declared in Sandbox.GpuBuffer ``` -------------------------------- ### BBox Static Methods Source: https://sbox.game/api/BBox Static methods for creating BBox instances. ```APIDOC ## BBox Static Methods ### FromBoxes (boxes) - **Returns**: BBox - **Description**: Creates a BBox from a collection of boxes. ### FromHeightAndRadius (height, radius) - **Returns**: BBox - **Description**: Creates an AABB of given height and radius. ### FromPoints (points, size) - **Returns**: BBox - **Description**: Creates a BBox from a collection of points and a size. ### FromPositionAndSize (center, size) - **Returns**: BBox - **Description**: Creates an AABB at a given position and size, which acts as a diameter of a sphere contained within the AABB. ``` -------------------------------- ### Borderless Property Source: https://sbox.game/api/Sandbox.Engine.Settings.RenderSettings/Borderless Gets or sets a boolean value indicating whether the application window should be borderless. ```APIDOC ## Borderless ### Description Gets or sets a boolean value indicating whether the application window should be borderless. ### Property Type bool ### Accessors - **get**: Retrieves the current borderless setting. - **set**: Sets the borderless setting. Accepts a boolean value. ``` -------------------------------- ### MaxFrameRateInactive Source: https://sbox.game/api/Sandbox.Engine.Settings.RenderSettings/MaxFrameRateInactive Gets or sets the maximum frame rate when the application is inactive. This property is of type int. ```APIDOC ## MaxFrameRateInactive ### Description Gets or sets the maximum frame rate when the application is inactive. ### Property Type int ### Accessors - get - set ### Declared in Sandbox.Engine.Settings.RenderSettings ``` -------------------------------- ### GradientFogSetup LerpTo Source: https://sbox.game/api/Sandbox.Rendering.GradientFogSetup/LerpTo Lerps the current GradientFogSetup to a desired state over a specified delta, with an optional clamp. ```APIDOC ## LerpTo ### Description Lerp this GradientFogSetup to a another, allowing transition states. ### Method Signature GradientFogSetup LerpTo (GradientFogSetup desired, float delta, bool clamp) ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **desired** (GradientFogSetup) - The target GradientFogSetup to interpolate towards. - **delta** (float) - The interpolation factor, typically between 0 and 1. - **clamp** (bool) - Optional. If true, the delta will be clamped. Defaults to true. ### Returns - **GradientFogSetup** - The interpolated GradientFogSetup state. ``` -------------------------------- ### Width Property Source: https://sbox.game/api/Sandbox.Bitmap/Width The Width property is an integer that gets and sets the width of the bitmap. It is declared in Sandbox.Bitmap. ```APIDOC ## Width Property ### Description Gets or sets the width of the bitmap. ### Type int ### Accessors get, set ``` -------------------------------- ### Compiler Configuration Struct Source: https://sbox.game/api/i/allstructs Configuration settings for a compiler. ```csharp struct Configuration ``` -------------------------------- ### IsConsoleApp Source: https://sbox.game/api/Sandbox.Application/IsConsoleApp Gets or sets a boolean value indicating if the application is running in a terminal or console environment. ```APIDOC ## IsConsoleApp ### Description True if running in a terminal like console, instead of a game window or editor. ### Property `static bool IsConsoleApp { get; set; }` ### Declared in Sandbox.Application ``` -------------------------------- ### ServerListConfig Struct for Modals Source: https://sbox.game/api/i/allstructs Configuration for the server list modal. ```csharp struct ServerListConfig ``` -------------------------------- ### Angles.Normal Source: https://sbox.game/api/Angles Gets a normalized version of this object, where the angle on each axis is normalized to the range of (-180, 180]. ```APIDOC ## Angles.Normal ### Description Returns normalized version of this object, meaning the angle on each axis is normalized to range of (-180,180]. ### Returns - **Angles** - The normalized angles object. ``` -------------------------------- ### Color32 Constructors Source: https://sbox.game/api/Color32 Initializes a Color32 object with specified red, green, blue, and alpha values. ```APIDOC ## Color32 Constructor ### Description Initializes a color with each component set to given values, in range [0,255]. ### Parameters - **r** (Byte) - Description: The red color component, in range of 0-255. - **g** (Byte) - Description: The green color component, in range of 0-255. - **b** (Byte) - Description: The blue color component, in range of 0-255. - **a** (Byte) - Description: The alpha/transparency color component, in range of 0 (fully transparent) to 255 (fully opaque). ``` -------------------------------- ### Vector2 Abs() Source: https://sbox.game/api/Vector2/Abs Returns a new vector with all values positive. For example, -5 becomes 5. ```APIDOC ## Vector2 Abs() ### Description Returns a new vector with all values positive. For example, -5 becomes 5. ### Method Vector2 ### Returns Type| Description ---|--- Vector2 | A new Vector2 instance with all component values made positive. ``` -------------------------------- ### HudPainter Constructor Source: https://sbox.game/api/Sandbox.Rendering.HudPainter/.ctor Initializes a new instance of the Sandbox.Rendering.HudPainter struct for the specified commandList. ```APIDOC ## HudPainter Constructor ### Description Initializes a new instance of the Sandbox.Rendering.HudPainter struct for the specified commandList. ### Parameters #### Path Parameters - **commandList** (CommandList) - Required - The command list to draw to. Must not be null. ``` -------------------------------- ### Get Sound File Channels Source: https://sbox.game/api/Sandbox.SoundFile/Channels Retrieves the number of channels present in the audio file. This is a read-only property. ```APIDOC ## Get Channels ### Description Gets the number of channels this audio file has. ### Property `int Channels { get; }` ### Declared in `Sandbox.SoundFile` ```