Skip to content
ConsoleMonster

API Reference

Struct

Rect

Namespace ConsoleMonster.Canvas
Assembly ConsoleMonster
Source Rect.cs:12
Base ValueType
Implements
IEquatable<Rect>
Modifiers sealed

A rectangle in buffer coordinates.

Inheritance

  • ValueType
  • Rect

Usage

Explore 6 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by 3

Accepted by parameters 3

Constructors

public Rect(Int32 x, Int32 y, Int32 width, Int32 height) #

Creates a rectangle; negative sizes become 0.

Parameters

x System.Int32 requiredposition: 0
Left column.
y System.Int32 requiredposition: 1
Top row.
width System.Int32 requiredposition: 2
Width.
height System.Int32 requiredposition: 3
Height.

Methods

Equals 2 overloads
public Boolean Equals(Rect other) #
Returns: Boolean

Indicates whether the current object is equal to another object of the same type.

Parameters

other ConsoleMonster.Canvas.Rect requiredposition: 0
An object to compare with this object.

Returns

true if the current object is equal to the other parameter; otherwise, false.

public override Boolean Equals(Object? obj) #
Returns: Boolean

Indicates whether this instance and a specified object are equal.

Parameters

obj System.Object? requiredposition: 0
The object to compare with the current instance.

Returns

true if obj and this instance are the same type and represent the same value; otherwise, false.

public override Int32 GetHashCode() #
Returns: Int32

Returns the hash code for this instance.

Returns

A 32-bit signed integer that is the hash code for this instance.

public Rect Inset(Int32 left, Int32 top, Int32 right, Int32 bottom) #
Returns: Rect

Returns the rectangle shrunk on each side.

Parameters

left System.Int32 requiredposition: 0
Left inset.
top System.Int32 requiredposition: 1
Top inset.
right System.Int32 requiredposition: 2
Right inset.
bottom System.Int32 requiredposition: 3
Bottom inset.

Returns

The inner rectangle.

public Rect Intersect(Rect other) #
Returns: Rect

Returns the intersection with another rectangle.

Parameters

other ConsoleMonster.Canvas.Rect requiredposition: 0
The other rectangle.

Returns

The overlap (possibly empty).

public override String ToString() #
Returns: String

Returns the fully qualified type name of this instance.

Returns

The fully qualified type name.

Properties

public Int32 X { get; } #

Left column.

public Int32 Y { get; } #

Top row.

public Int32 Width { get; } #

Width.

public Int32 Height { get; } #

Height.

public Int32 Right { get; } #

Exclusive right edge.

public Int32 Bottom { get; } #

Exclusive bottom edge.

public Boolean IsEmpty { get; } #

Whether the rectangle has no area.