s&box docs

public sealed struct Sandbox.RectInt

Represents a rectangle but with whole numbers

Constructors

Showing 2 constructors

Methods

Showing 12 methods

public Sandbox.RectInt AddPoint(Vector2Int pos)

Returns this rect expanded to include this point

public static Sandbox.RectInt FromPoints(Vector2Int a, Vector2Int b)

Create a rect between two points. The order of the points doesn't matter.

Properties

Showing 14 properties

public int Sandbox.RectInt.Bottom { get; set; }

Position of rect's bottom edge relative to its parent.

public Vector2Int Sandbox.RectInt.BottomLeft { get; set; }

Position of the bottom left edge of this rect.

public Vector2Int Sandbox.RectInt.BottomRight { get; set; }

Position of the bottom right edge of this rect.

public Vector2 Sandbox.RectInt.Center { get; set; }

Center of this rect.

public int Sandbox.RectInt.Height { get; set; }

Height of the rect.

public int Sandbox.RectInt.Left { get; set; }

Position of rect's left edge relative to its parent, can also be interpreted as its position on the X axis.

public int Sandbox.RectInt.Right { get; set; }

Position of rect's right edge relative to its parent.

public int Sandbox.RectInt.Top { get; set; }

Position of rect's top edge relative to its parent, can also be interpreted as its position on the Y axis.

public Vector2Int Sandbox.RectInt.TopLeft { get; set; }

Position of the top left edge of this rect.

public Vector2Int Sandbox.RectInt.TopRight { get; set; }

Position of the top right edge of this rect.

public int Sandbox.RectInt.Width { get; set; }

Width of the rect.

public Sandbox.RectInt Sandbox.RectInt.WithoutPosition { get; set; }

Returns this rect with position set to 0 on both axes.

Metadata

FieldValue
NamespaceSandbox
Typeclass
AssemblySandbox.System
Doc IDT:Sandbox.RectInt

On this page

Constructorspublic RectInt(System.Int32 x, System.Int32 y, System.Int32 width, System.Int32 height)public RectInt(Vector2Int point, Vector2Int size = null)Methodspublic System.Void Add(Sandbox.RectInt r)public System.Void Add(Vector2Int point)public Sandbox.RectInt AddPoint(Vector2Int pos)public static Sandbox.RectInt FromPoints(Vector2Int a, Vector2Int b)public Sandbox.RectInt Grow(System.Int32 left, System.Int32 top, System.Int32 right, System.Int32 bottom)public Sandbox.RectInt Grow(System.Int32 x, System.Int32 y)public Sandbox.RectInt Grow(System.Int32 amt)public System.Boolean IsInside(Sandbox.RectInt rect, System.Boolean fullyInside = False)public System.Boolean IsInside(Vector2Int pos)public Sandbox.RectInt Shrink(System.Int32 left, System.Int32 top, System.Int32 right, System.Int32 bottom)public Sandbox.RectInt Shrink(System.Int32 x, System.Int32 y)public Sandbox.RectInt Shrink(System.Int32 amt)Propertiespublic System.Int32 Sandbox.RectInt.Bottom { get; set; }public Vector2Int Sandbox.RectInt.BottomLeft { get; set; }public Vector2Int Sandbox.RectInt.BottomRight { get; set; }public Vector2 Sandbox.RectInt.Center { get; set; }public System.Int32 Sandbox.RectInt.Height { get; set; }public System.Int32 Sandbox.RectInt.Left { get; set; }public Vector2Int Sandbox.RectInt.Position { get; set; }public System.Int32 Sandbox.RectInt.Right { get; set; }public Vector2Int Sandbox.RectInt.Size { get; set; }public System.Int32 Sandbox.RectInt.Top { get; set; }public Vector2Int Sandbox.RectInt.TopLeft { get; set; }public Vector2Int Sandbox.RectInt.TopRight { get; set; }public System.Int32 Sandbox.RectInt.Width { get; set; }public Sandbox.RectInt Sandbox.RectInt.WithoutPosition { get; set; }Metadata