struct RectInt

in global :: Sandbox

Represents a rectangle but with whole numbers


public RectInt( ref int x, ref int y, ref int width, ref int height )

Initialize a Rect at given position and with given size.

public RectInt( ref Vector2Int point, ref Vector2Int size = null )

Initialize a Rect at given position and with given size.

public int Width { get; set; }

Width of the rect.

public int Height { get; set; }

Height of the rect.

public int 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 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 int Right { get; set; }

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

public int Bottom { get; set; }

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

public Vector2Int Position { get; set; }

Position of this rect.

public Vector2 Center { get; }

Center of this rect.

public Vector2Int Size { get; set; }

Size of this rect.

public RectInt WithoutPosition { get; }

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

public bool IsInside( ref RectInt rect, bool fullyInside = False )

Return true if the passed rect is partially or fully inside this rect.

  • rect The passed rect to test.
  • fullyInside to test if the given rect is completely inside this rect. to test for an intersection.

public bool IsInside( ref Vector2Int pos )

Return true if the passed point is inside this rect.

public RectInt Shrink( ref int left, ref int top, ref int right, ref int bottom )

Returns a Rect shrunk in every direction by given values.

public RectInt Shrink( ref int x, ref int y )

Returns a Rect shrunk in every direction by given values on each axis.

public RectInt Shrink( ref int amt )

Returns a Rect shrunk in every direction by given amount.

public RectInt Grow( ref int left, ref int top, ref int right, ref int bottom )

Returns a Rect grown in every direction by given amounts.

public RectInt Grow( ref int x, ref int y )

Returns a Rect grown in every direction by given values on each axis.

public RectInt Grow( ref int amt )

Returns a Rect grown in every direction by given amount.

public static RectInt FromPoints( ref Vector2Int a, ref Vector2Int b )

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

public void Add( RectInt r )

Expand this Rect to contain the other rect

public void Add( Vector2Int point )

Expand this Rect to contain the point

public RectInt AddPoint( Vector2Int pos )

Returns this rect expanded to include this point

public Vector2Int BottomLeft { get; }

Position of the bottom left edge of this rect.

public Vector2Int BottomRight { get; }

Position of the bottom right edge of this rect.

public Vector2Int TopRight { get; }

Position of the top right edge of this rect.

public Vector2Int TopLeft { get; }

Position of the top left edge of this rect.

public Type GetType( )

😔 No documentation found.

public int GetHashCode( )

😔 No documentation found.

public bool Equals( RectInt o )

😔 No documentation found.

public bool Equals( object obj )

😔 No documentation found.

public static RectInt op_Addition( ref RectInt a, ref RectInt b )

😔 No documentation found.

public static bool op_Equality( RectInt left, RectInt right )

😔 No documentation found.

public string ToString( )

😔 No documentation found.

public static RectInt op_Multiply( ref RectInt a, ref Vector2Int b )

😔 No documentation found.

public static RectInt op_Addition( RectInt r, ref Vector2Int p )

😔 No documentation found.

public static bool op_Inequality( RectInt left, RectInt right )

😔 No documentation found.

public static RectInt op_Multiply( ref RectInt a, ref int b )

😔 No documentation found.