|
Nebula
|
Describes a 2D-rectangle.
Inherits IEquatable.
Public Member Functions | |
| Rectangle (int x, int y, int width, int height) | |
| Creates a new instance of Rectangle struct, with the specified position, width, and height. | |
| Rectangle (Point location, Point size) | |
| Creates a new instance of Rectangle struct, with the specified location and size. | |
| bool | Contains (int x, int y) |
| Gets whether or not the provided coordinates lie within the bounds of this Rectangle. | |
| bool | Contains (float x, float y) |
| Gets whether or not the provided coordinates lie within the bounds of this Rectangle. | |
| bool | Contains (Point value) |
| Gets whether or not the provided Point lies within the bounds of this Rectangle. | |
| void | Contains (ref Point value, out bool result) |
| Gets whether or not the provided Point lies within the bounds of this Rectangle. | |
| bool | Contains (Vector2 value) |
| Gets whether or not the provided Vector2 lies within the bounds of this Rectangle. | |
| void | Contains (ref Vector2 value, out bool result) |
| Gets whether or not the provided Vector2 lies within the bounds of this Rectangle. | |
| bool | Contains (Rectangle value) |
| Gets whether or not the provided Rectangle lies within the bounds of this Rectangle. | |
| void | Contains (ref Rectangle value, out bool result) |
| Gets whether or not the provided Rectangle lies within the bounds of this Rectangle. | |
| override bool | Equals (object obj) |
| Compares whether current instance is equal to specified Object. | |
| bool | Equals (Rectangle other) |
| Compares whether current instance is equal to specified Rectangle. | |
| override int | GetHashCode () |
| Gets the hash code of this Rectangle. | |
| void | Inflate (int horizontalAmount, int verticalAmount) |
| Adjusts the edges of this Rectangle by specified horizontal and vertical amounts. | |
| void | Inflate (float horizontalAmount, float verticalAmount) |
| Adjusts the edges of this Rectangle by specified horizontal and vertical amounts. | |
| bool | Intersects (Rectangle value) |
| Gets whether or not the other Rectangle intersects with this rectangle. | |
| void | Intersects (ref Rectangle value, out bool result) |
| Gets whether or not the other Rectangle intersects with this rectangle. | |
| void | Offset (int offsetX, int offsetY) |
| Changes the Location of this Rectangle. | |
| void | Offset (float offsetX, float offsetY) |
| Changes the Location of this Rectangle. | |
| void | Offset (Point amount) |
| Changes the Location of this Rectangle. | |
| void | Offset (Vector2 amount) |
| Changes the Location of this Rectangle. | |
| override string | ToString () |
| Returns a String representation of this Rectangle in the format: {X:[X] Y:[Y] Width:[Width] Height:[Height]}. | |
| void | Deconstruct (out int x, out int y, out int width, out int height) |
| Deconstruction method for Rectangle. | |
Static Public Member Functions | |
| static bool | operator== (Rectangle a, Rectangle b) |
| Compares whether two Rectangle instances are equal. | |
| static bool | operator!= (Rectangle a, Rectangle b) |
| Compares whether two Rectangle instances are not equal. | |
| static Rectangle | Intersect (Rectangle value1, Rectangle value2) |
| Creates a new Rectangle that contains overlapping region of two other rectangles. | |
| static void | Intersect (ref Rectangle value1, ref Rectangle value2, out Rectangle result) |
| Creates a new Rectangle that contains overlapping region of two other rectangles. | |
| static Rectangle | Union (Rectangle value1, Rectangle value2) |
| Creates a new Rectangle that completely contains two other rectangles. | |
| static void | Union (ref Rectangle value1, ref Rectangle value2, out Rectangle result) |
| Creates a new Rectangle that completely contains two other rectangles. | |
Public Attributes | |
| int | X |
| The x coordinate of the top-left corner of this Rectangle. | |
| int | Y |
| The y coordinate of the top-left corner of this Rectangle. | |
| int | Width |
| The width of this Rectangle. | |
| int | Height |
| The height of this Rectangle. | |
Properties | |
| static Rectangle | Empty [get] |
| Returns a Rectangle with X=0, Y=0, Width=0, Height=0. | |
| int | Left [get] |
| Returns the x coordinate of the left edge of this Rectangle. | |
| int | Right [get] |
| Returns the x coordinate of the right edge of this Rectangle. | |
| int | Top [get] |
| Returns the y coordinate of the top edge of this Rectangle. | |
| int | Bottom [get] |
| Returns the y coordinate of the bottom edge of this Rectangle. | |
| bool | IsEmpty [get] |
| Whether or not this Rectangle has a Width and Height of 0, and a Location of (0, 0). | |
| Point | Location [get, set] |
| The top-left coordinates of this Rectangle. | |
| Point | Size [get, set] |
| The width-height coordinates of this Rectangle. | |
| Point | Center [get] |
| A Point located in the center of this Rectangle. | |
| string | DebugDisplayString [get] |
Static Private Attributes | |
| static Rectangle | emptyRectangle = new Rectangle() |
|
inline |
Creates a new instance of Rectangle struct, with the specified position, width, and height.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Deconstruction method for Rectangle.
| x | |
| y | |
| width | |
| height |
|
inline |
Compares whether current instance is equal to specified Object.
| obj | The Object to compare. |
true if the instances are equal; false otherwise.
|
inline |
|
inline |
|
inline |
Adjusts the edges of this Rectangle by specified horizontal and vertical amounts.
| horizontalAmount | Value to adjust the left and right edges. |
| verticalAmount | Value to adjust the top and bottom edges. |
|
inline |
Adjusts the edges of this Rectangle by specified horizontal and vertical amounts.
| horizontalAmount | Value to adjust the left and right edges. |
| verticalAmount | Value to adjust the top and bottom edges. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| int Mathf.Rectangle.Height |
The height of this Rectangle.
| int Mathf.Rectangle.Width |
The width of this Rectangle.
| int Mathf.Rectangle.X |
The x coordinate of the top-left corner of this Rectangle.
| int Mathf.Rectangle.Y |
The y coordinate of the top-left corner of this Rectangle.
|
get |
Returns the y coordinate of the bottom edge of this Rectangle.
|
get |
|
getpackage |
|
get |
|
get |
Returns the x coordinate of the left edge of this Rectangle.
|
get |
Returns the x coordinate of the right edge of this Rectangle.
|
get |
Returns the y coordinate of the top edge of this Rectangle.