s&box docs
API ReferenceSandbox.UI

public sealed struct Sandbox.UI.Margin

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

Broader workflow and conceptual references connected to this API.

Constructors

Showing 5 constructors

Methods

Showing 3 methods

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

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

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

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

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

Returns true if margin is practically zero

Parameters

  • tolerance: Default: 1E-06

Properties

Showing 9 properties

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

Thickness of the bottom margin.

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

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

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

Height of the inner square contained within the margin.

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

Thickness of the left side margin.

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

Thickness of the right side margin.

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

Size of the inner square contained within the margin.

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

Thickness of the top margin.

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

Width of the inner square contained within the margin.

Metadata

FieldValue
NamespaceSandbox.UI
Typeclass
AssemblySandbox.System
Doc IDT:Sandbox.UI.Margin

On this page