Show / Hide Table of Contents

# Struct Rect

Stores a set of four integers that represent the location and size of a rectangle

###### Namespace: Terminal

###### Assembly: Terminal.dll

##### Syntax

    public struct Rect

### Constructors

#### Rect(Point, Size)

Rectangle Constructor

##### Declaration

    public Rect (Terminal.Point location, Terminal.Size size);

##### Parameters

Type | Name | Description
--- | --- | ---
Point | location | To be added.
Size | size | To be added.

##### Remarks

Creates a Rectangle from Point and Size values.

#### Rect(Int32, Int32, Int32, Int32)

Rectangle Constructor

##### Declaration

    public Rect (int x, int y, int width, int height);

##### Parameters

Type | Name | Description
--- | --- | ---
System.Int32 | x | To be added.
System.Int32 | y | To be added.
System.Int32 | width | To be added.
System.Int32 | height | To be added.

##### Remarks

Creates a Rectangle from a specified x,y location and width and height values.

### Fields

#### Empty

Empty Shared Field

##### Declaration

    public static readonly Terminal.Rect Empty;

##### Field Value

Type | Description
--- | ---
Rect | To be added.

##### Remarks

An uninitialized Rectangle Structure.

#### Height

Gets or sets the height of this Rectangle structure.

##### Declaration

    public int Height;

##### Field Value

Type | Description
--- | ---
System.Int32 | To be added.

#### Width

Gets or sets the width of this Rect structure.

##### Declaration

    public int Width;

##### Field Value

Type | Description
--- | ---
System.Int32 | To be added.

#### X

Gets or sets the x-coordinate of the upper-left corner of this Rectangle structure.

##### Declaration

    public int X;

##### Field Value

Type | Description
--- | ---
System.Int32 | To be added.

#### Y

Gets or sets the y-coordinate of the upper-left corner of this Rectangle structure.

##### Declaration

    public int Y;

##### Field Value

Type | Description
--- | ---
System.Int32 | To be added.

### Properties

#### Bottom

Bottom Property

##### Declaration

    public int Bottom { get; }

##### Property Value

Type | Description
--- | ---
System.Int32 | To be added.

##### Remarks

The Y coordinate of the bottom edge of the Rectangle. Read only.

#### IsEmpty

IsEmpty Property

##### Declaration

    public bool IsEmpty { get; }

##### Property Value

Type | Description
--- | ---
System.Boolean | To be added.

##### Remarks

Indicates if the width or height are zero. Read only.

#### Left

Left Property

##### Declaration

    public int Left { get; }

##### Property Value

Type | Description
--- | ---
System.Int32 | To be added.

##### Remarks

The X coordinate of the left edge of the Rectangle. Read only.

#### Location

Location Property

##### Declaration

    public Terminal.Point Location { get; set; }

##### Property Value

Type | Description
--- | ---
Point | To be added.

##### Remarks

The Location of the top-left corner of the Rectangle.

#### Right

Right Property

##### Declaration

    public int Right { get; }

##### Property Value

Type | Description
--- | ---
System.Int32 | To be added.

##### Remarks

The X coordinate of the right edge of the Rectangle. Read only.

#### Size

Size Property

##### Declaration

    public Terminal.Size Size { get; set; }

##### Property Value

Type | Description
--- | ---
Size | To be added.

##### Remarks

The Size of the Rectangle.

#### Top

Top Property

##### Declaration

    public int Top { get; }

##### Property Value

Type | Description
--- | ---
System.Int32 | To be added.

##### Remarks

The Y coordinate of the top edge of the Rectangle. Read only.

### Methods

#### Contains(Point)

Contains Method

##### Declaration

    public bool Contains (Terminal.Point pt);

##### Parameters

Type | Name | Description
--- | --- | ---
Point | pt | To be added.

##### Returns

Type | Description
--- | ---
System.Boolean | To be added.

##### Remarks

Checks if a Point lies within this Rectangle.

#### Contains(Rect)

Contains Method

##### Declaration

    public bool Contains (Terminal.Rect rect);

##### Parameters

Type | Name | Description
--- | --- | ---
Rect | rect | To be added.

##### Returns

Type | Description
--- | ---
System.Boolean | To be added.

##### Remarks

Checks if a Rectangle lies entirely within this Rectangle.

#### Contains(Int32, Int32)

Contains Method

##### Declaration

    public bool Contains (int x, int y);

##### Parameters

Type | Name | Description
--- | --- | ---
System.Int32 | x | To be added.
System.Int32 | y | To be added.

##### Returns

Type | Description
--- | ---
System.Boolean | To be added.

##### Remarks

Checks if an x,y coordinate lies within this Rectangle.

#### Equals(Object)

Equals Method

##### Declaration

    public override bool Equals (object obj);

##### Parameters

Type | Name | Description
--- | --- | ---
System.Object | obj | To be added.

##### Returns

Type | Description
--- | ---
System.Boolean | To be added.

##### Remarks

Checks equivalence of this Rectangle and another object.

#### FromLTRB(Int32, Int32, Int32, Int32)

FromLTRB Shared Method

##### Declaration

    public static Terminal.Rect FromLTRB (int left, int top, int right, int bottom);

##### Parameters

Type | Name | Description
--- | --- | ---
System.Int32 | left | To be added.
System.Int32 | top | To be added.
System.Int32 | right | To be added.
System.Int32 | bottom | To be added.

##### Returns

Type | Description
--- | ---
Rect | To be added.

##### Remarks

Produces a Rectangle structure from left, top, right and bottom coordinates.

#### GetHashCode()

GetHashCode Method

##### Declaration

    public override int GetHashCode ();

##### Returns

Type | Description
--- | ---
System.Int32 | To be added.

##### Remarks

Calculates a hashing value.

#### Inflate(Size)

Inflate Method

##### Declaration

    public void Inflate (Terminal.Size size);

##### Parameters

Type | Name | Description
--- | --- | ---
Size | size | To be added.

##### Remarks

Inflates the Rectangle by a specified Size.

#### Inflate(Int32, Int32)

Inflate Method

##### Declaration

    public void Inflate (int width, int height);

##### Parameters

Type | Name | Description
--- | --- | ---
System.Int32 | width | To be added.
System.Int32 | height | To be added.

##### Remarks

Inflates the Rectangle by a specified width and height.

#### Inflate(Rect, Int32, Int32)

Inflate Shared Method

##### Declaration

    public static Terminal.Rect Inflate (Terminal.Rect rect, int x, int y);

##### Parameters

Type | Name | Description
--- | --- | ---
Rect | rect | To be added.
System.Int32 | x | To be added.
System.Int32 | y | To be added.

##### Returns

Type | Description
--- | ---
Rect | To be added.

##### Remarks

Produces a new Rectangle by inflating an existing Rectangle by the specified coordinate values.

#### Intersect(Rect, Rect)

Intersect Shared Method

##### Declaration

    public static Terminal.Rect Intersect (Terminal.Rect a, Terminal.Rect b);

##### Parameters

Type | Name | Description
--- | --- | ---
Rect | a | To be added.
Rect | b | To be added.

##### Returns

Type | Description
--- | ---
Rect | To be added.

##### Remarks

Produces a new Rectangle by intersecting 2 existing Rectangles. Returns null if there is no intersection.

#### Intersect(Rect)

Intersect Method

##### Declaration

    public void Intersect (Terminal.Rect rect);

##### Parameters

Type | Name | Description
--- | --- | ---
Rect | rect | To be added.

##### Remarks

Replaces the Rectangle with the intersection of itself and another Rectangle.

#### IntersectsWith(Rect)

IntersectsWith Method

##### Declaration

    public bool IntersectsWith (Terminal.Rect rect);

##### Parameters

Type | Name | Description
--- | --- | ---
Rect | rect | To be added.

##### Returns

Type | Description
--- | ---
System.Boolean | To be added.

##### Remarks

Checks if a Rectangle intersects with this one.

#### Offset(Point)

Offset Method

##### Declaration

    public void Offset (Terminal.Point pos);

##### Parameters

Type | Name | Description
--- | --- | ---
Point | pos | To be added.

##### Remarks

Moves the Rectangle a specified distance.

#### Offset(Int32, Int32)

Offset Method

##### Declaration

    public void Offset (int x, int y);

##### Parameters

Type | Name | Description
--- | --- | ---
System.Int32 | x | To be added.
System.Int32 | y | To be added.

##### Remarks

Moves the Rectangle a specified distance.

#### ToString()

ToString Method

##### Declaration

    public override string ToString ();

##### Returns

Type | Description
--- | ---
System.String | To be added.

##### Remarks

Formats the Rectangle as a string in (x,y,w,h) notation.

#### Union(Rect, Rect)

Union Shared Method

##### Declaration

    public static Terminal.Rect Union (Terminal.Rect a, Terminal.Rect b);

##### Parameters

Type | Name | Description
--- | --- | ---
Rect | a | To be added.
Rect | b | To be added.

##### Returns

Type | Description
--- | ---
Rect | To be added.

##### Remarks

Produces a new Rectangle from the union of 2 existing Rectangles.

### Operators

#### op_Equality(Rect, Rect)

Equality Operator

##### Declaration

    public static bool op_Equality (Terminal.Rect left, Terminal.Rect right);

##### Parameters

Type | Name | Description
--- | --- | ---
Rect | left | To be added.
Rect | right | To be added.

##### Returns

Type | Description
--- | ---
System.Boolean | To be added.

##### Remarks

Compares two Rectangle objects. The return value is based on the equivalence of the Location and Size properties of the two Rectangles.

#### op_Inequality(Rect, Rect)

Inequality Operator

##### Declaration

    public static bool op_Inequality (Terminal.Rect left, Terminal.Rect right);

##### Parameters

Type | Name | Description
--- | --- | ---
Rect | left | To be added.
Rect | right | To be added.

##### Returns

Type | Description
--- | ---
System.Boolean | To be added.

##### Remarks

Compares two Rectangle objects. The return value is based on the equivalence of the Location and Size properties of the two Rectangles.