Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

VRageMath.Rectangle

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

IndexNamespace Index

Rectangle Struct

public struct Rectangle: IEquatable<Rectangle>

Defines a rectangle.

Namespace: VRageMath
Assembly: VRage.Math.dll

Implements:

Fields

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

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

Rectangle(int x, int y, int width, int height)

Methods

static Rectangle Intersect(Rectangle value1, Rectangle value2)

Creates a Rectangle defining the area where one rectangle overlaps with another rectangle.

static void Intersect(ref Rectangle value1, ref Rectangle value2, out Rectangle result)

Creates a Rectangle defining the area where one rectangle overlaps with another rectangle.

static Rectangle Union(Rectangle value1, Rectangle value2)

Creates a new Rectangle that exactly contains two other rectangles.

static void Union(ref Rectangle value1, ref Rectangle value2, out Rectangle result)

Creates a new Rectangle that exactly contains two other rectangles.

bool Contains(int x, int y)

Determines whether this Rectangle contains a specified point represented by its x- and y-coordinates.

bool Contains(Point value)

Determines whether this Rectangle contains a specified Point.

void Contains(ref Point value, out bool result)

Determines whether this Rectangle contains a specified Point.

bool Contains(Rectangle value)

Determines whether this Rectangle entirely contains a specified Rectangle.

void Contains(ref Rectangle value, out bool result)

Determines whether this Rectangle entirely contains a specified Rectangle.

bool Equals(Rectangle other)

Determines whether the specified Object is equal to the Rectangle.

bool Equals(object obj)

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 horizontalAmount, int verticalAmount)

Pushes the edges of the Rectangle out by the horizontal and vertical values specified.

bool Intersects(Rectangle value)

Determines whether a specified Rectangle intersects with this Rectangle.

void Intersects(ref Rectangle value, out bool result)

Determines whether a specified Rectangle intersects with this Rectangle.

void Offset(Point amount)

Changes the position of the Rectangle.

void Offset(int offsetX, int offsetY)

Changes the position of the Rectangle.

string ToString()

Retrieves a string representation of the current object.

Clone this wiki locally