S&box Wiki


A variable unit based length. ie, could be a percentage or a pixel length



static Sandbox.UI.Length Auto { get; }
static Sandbox.UI.Length Contain { get; }
static Sandbox.UI.Length Cover { get; }


static Sandbox.UI.Length? Fraction( float fraction )
Create a length in percents
float GetPixels( float dimension, float contentSize )
Get the pixel size but also evaluate content size to support use Start, End, Center
static Sandbox.UI.Length? Parse( string value )
Parse a length. This is used by the stylesheet parsing system.
static Sandbox.UI.Length? Percent( float percent )
Create a length in percents
static Sandbox.UI.Length? Pixels( float pixels )
Create a length in pixels