API ReferenceSandbox.UI

Marginclass

Represents a Rect where each side is the thickness of an edge/padding/margin/border, rather than positions.

objectMargin
Namespace
Sandbox.UI
Assembly
Sandbox.System
Declaration
public sealed struct Sandbox.UI.Margin

Constructors5

Showing 5 constructors

Methods3

Showing 3 methods

public Sandbox.UI.Margin EdgeAdd(Sandbox.UI.Margin edges)PUBLIC

Where padding is an edge type rect, will return this rect expanded with those edges.

ParameterTypeDescription
edgesMargin
Returns:Margin

public Sandbox.UI.Margin EdgeSubtract(Sandbox.UI.Margin edges)PUBLIC

Where padding is an edge type rect, will return this rect contracted by those edges. The inverse of `Sandbox.UI.Margin.EdgeAdd(Sandbox.UI.Margin)`.

ParameterTypeDescription
edgesMargin
Returns:Margin

public bool IsNearlyZero(double tolerance = 1E-06)PUBLIC

Returns true if margin is practically zero

ParameterTypeDescription
tolerance = 1E-06double
Returns:bool

Properties9

Showing 9 properties

public float Sandbox.UI.Margin.Bottom { get; set; }PUBLICGETSET

Thickness of the bottom margin.

Returns:float

public Vector2 Sandbox.UI.Margin.EdgeSize { get; set; }PUBLICGETSET

When the Rect describes edges, this returns the total size of the edges in each direction

Returns:Vector2

public float Sandbox.UI.Margin.Height { get; set; }PUBLICGETSET

Height of the inner square contained within the margin.

Returns:float

public float Sandbox.UI.Margin.Left { get; set; }PUBLICGETSET

Thickness of the left side margin.

Returns:float

public float Sandbox.UI.Margin.Right { get; set; }PUBLICGETSET

Thickness of the right side margin.

Returns:float

public Vector2 Sandbox.UI.Margin.Size { get; set; }PUBLICGETSET

Size of the inner square contained within the margin.

Returns:Vector2

public float Sandbox.UI.Margin.Top { get; set; }PUBLICGETSET

Thickness of the top margin.

Returns:float

public float Sandbox.UI.Margin.Width { get; set; }PUBLICGETSET

Width of the inner square contained within the margin.

Returns:float

On this page