Skip to content
This repository was archived by the owner on Dec 13, 2025. It is now read-only.

VRageMath.Rectangle

Morten Aune Lyrstad edited this page Apr 16, 2022 · 51 revisions

IndexNamespace Index

Rectangle Struct

public struct Rectangle: IEquatable\<Rectangle\>

Defines a rectangle.

Namespace: VRageMath
Assembly: VRage.Math.dll

Implements:

Fields

Member Description
int Height Specifies the height of the rectangle.
int Width Specifies the width of the rectangle.
int X Specifies the x-coordinate of the rectangle.
int Y Specifies the y-coordinate of the rectangle.

Properties

Member Description
int Bottom { get; } Returns the y-coordinate of the bottom of the rectangle.
Point Center { get; } Gets the Point that specifies the center of the rectangle.
int Left { get; } Returns the x-coordinate of the left side of the rectangle.
Point Location { get; set; } Gets or sets the upper-left value of the Rectangle.
int Right { get; } Returns the x-coordinate of the right side of the rectangle.
int Top { get; } Returns the y-coordinate of the top of the rectangle.

Constructors

Member Description
Rectangle(int, int, int, int)

Methods

Member Description
static Rectangle Intersect(Rectangle, Rectangle) Creates a Rectangle defining the area where one rectangle overlaps with another rectangle.
static void Intersect(ref Rectangle, ref Rectangle, out Rectangle) Creates a Rectangle defining the area where one rectangle overlaps with another rectangle.
static Rectangle Union(Rectangle, Rectangle) Creates a new Rectangle that exactly contains two other rectangles.
static void Union(ref Rectangle, ref Rectangle, out Rectangle) Creates a new Rectangle that exactly contains two other rectangles.
bool Contains(int, int) Determines whether this Rectangle contains a specified point represented by its x- and y-coordinates.
bool Contains(Point) Determines whether this Rectangle contains a specified Point.
void Contains(ref Point, out bool) Determines whether this Rectangle contains a specified Point.
bool Contains(Rectangle) Determines whether this Rectangle entirely contains a specified Rectangle.
void Contains(ref Rectangle, out bool) Determines whether this Rectangle entirely contains a specified Rectangle.
bool Equals(Rectangle) Determines whether the specified Object is equal to the Rectangle.
bool Equals(object) Returns a value that indicates whether the current instance is equal to a specified object.
int GetHashCode() Gets the hash code for this object.
void Inflate(int, int) Pushes the edges of the Rectangle out by the horizontal and vertical values specified.
bool Intersects(Rectangle) Determines whether a specified Rectangle intersects with this Rectangle.
void Intersects(ref Rectangle, out bool) Determines whether a specified Rectangle intersects with this Rectangle.
void Offset(Point) Changes the position of the Rectangle.
void Offset(int, int) Changes the position of the Rectangle.
string ToString() Retrieves a string representation of the current object.

Clone this wiki locally