Wiki
Clone wikiRogueSharp / RogueSharp / Rectangle / README
Rectangle Class
A class that defines a rectangle
Inheritance Hierarchy
SystemObject
RogueSharpRectangle
Namespace: RogueSharp
Assembly:
Syntax
public class Rectangle : IEquatable<Rectangle>
The Rectangle type exposes the following members.
Constructors
Name | Description |
---|---|
Rectangle | Initializes a new instance of Rectangle |
Rectangle(Int32, Int32, Int32, Int32) | Initializes a new instance of Rectangle |
Properties
Name | Description |
---|---|
Bottom | Returns the y-coordinate of the bottom of the rectangle |
Center | Returns the Point that specifies the center of the rectangle |
Empty | Returns a Rectangle with all of its values set to zero |
Height | Specifies the Height of the Rectangle |
IsEmpty | Returns a value that indicates whether the Rectangle is empty true if the Rectangle is empty; otherwise false |
Left | Returns the x-coordinate of the left side of the rectangle |
Location | Gets or sets the Point representing the upper-left value of the Rectangle |
Right | Returns the x-coordinate of the right side of the rectangle |
Top | Returns the y-coordinate of the top of the rectangle |
Width | Specifies the Width of the Rectangle |
X | Specifies the x-coordinate of the Rectangle with 0 being to the left and increasing as the Rectangle is moved to the right |
Y | Specifies the y-coordinate of the Rectangle with 0 being at the top and increasing as the Rectangle is moved downwards |
Methods
Name | Description |
---|---|
Contains(Point) | Determines whether this Rectangle contains a specified Point |
Contains(Rectangle) | Determines whether this Rectangle entirely contains the specified Rectangle |
Contains(Int32, Int32) | Determines whether this Rectangle contains a specified point represented by its x and y-coordinates |
Equals(Object) | Determines whether two Rectangle instances are equal (Overrides ObjectEquals(Object).) |
Equals(Rectangle) | Determines whether two Rectangle instances are equal |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
GetHashCode | Gets the hash code for this object which can help for quick checks of equality or when inserting this Rectangle into a hash-based collection such as a Dictionary or Hashtable (Overrides ObjectGetHashCode.) |
GetType | Gets the Type of the current instance. (Inherited from Object.) |
Inflate | Pushes the edges of the Rectangle out by the specified horizontal and vertical values |
Intersect(Rectangle, Rectangle) | Creates a Rectangle defining the area where one Rectangle overlaps with another Rectangle |
Intersect(Rectangle, Rectangle, Rectangle) | Creates a Rectangle defining the area where one Rectangle overlaps with another Rectangle |
Intersects(Rectangle) | Determines whether this Rectangle intersects with the specified Rectangle |
Intersects(Rectangle, Boolean) | Determines whether this Rectangle intersects with the specified Rectangle |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
Offset(Point) | Changes the position of the Rectangles by the values of the specified Point |
Offset(Int32, Int32) | Changes the position of the Rectangle by the specified x and y offsets |
ToString | Returns a string that represents the current Rectangle (Overrides ObjectToString.) |
Union(Rectangle, Rectangle) | Creates a new Rectangle that exactly contains the specified two Rectangles |
Union(Rectangle, Rectangle, Rectangle) | Creates a new Rectangle that exactly contains the specified two Rectangles |
Operators
Name | Description |
---|---|
Equality | Compares two rectangles for equality |
Inequality | Compares two rectangles for inequality |
See Also
Reference
[34]: 2014-2016 Faron Bracy
Updated