A rectangle representing an area in 2D space.
More...
|
readonly int | X |
| The X position of this rectangle, in screen pixels. More...
|
|
readonly int | Y |
| The Y position of this rectangle, in screen pixels. More...
|
|
readonly int | Width |
| The width of this rectangle in pixels. More...
|
|
readonly int | Height |
| The height of this rectangle in pixels. More...
|
|
readonly Color | Color |
| Optional color of this rectangle, if it is to be drawn onto the screen. More...
|
|
A rectangle representing an area in 2D space.
TriDevs.TriEngine.Rectangle.Rectangle |
( |
Point< int > |
position, |
|
|
Point< int > |
size, |
|
|
Color? |
color = null |
|
) |
| |
Initializes a new Rectangle with position and size based on two point objects.
- Parameters
-
position | The point to get position from. |
size | The point to get width and height from. |
color | Color of this rectangle, set to null for default color of black. |
66 :
this(position.X, position.Y, size.X, size.Y, color)
TriDevs.TriEngine.Rectangle.Rectangle |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
width, |
|
|
int |
height, |
|
|
Color? |
color = null |
|
) |
| |
Initializes a new rectangle with specified position and size.
- Parameters
-
x | X-position of this rectangle, in screen pixels. |
y | Y-position of this rectangle, in screen pixels. |
width | Width of this rectangle, in pixels. |
height | Height of this rectangle, in pixels. |
color | Color of this rectangle, set to null for default color of black. |
bool TriDevs.TriEngine.Rectangle.Equals |
( |
Rectangle |
other | ) |
|
115 return X == other.X &&
Y == other.Y &&
Width == other.Width &&
Height == other.Height;
bool TriDevs.TriEngine.Rectangle.Intersects |
( |
Rectangle |
other | ) |
|
Returns whether this rectangle is intersecting with another rectangle.
- Parameters
-
- Returns
- True if this rectangle is intersecting with the other rectangle, false otherwise.
98 if (
X >= other.X && (
X +
Width) <= (other.X + other.Width))
101 if (
X < other.X && (
X +
Width) >= other.X)
104 if (
Y >= other.Y && (
Y +
Height) <= (other.Y + other.Height))
107 if (
Y < other.Y && (
Y +
Height) >= other.Y)
readonly Color TriDevs.TriEngine.Rectangle.Color |
Optional color of this rectangle, if it is to be drawn onto the screen.
readonly int TriDevs.TriEngine.Rectangle.Height |
The height of this rectangle in pixels.
readonly int TriDevs.TriEngine.Rectangle.Width |
The width of this rectangle in pixels.
readonly int TriDevs.TriEngine.Rectangle.X |
The X position of this rectangle, in screen pixels.
readonly int TriDevs.TriEngine.Rectangle.Y |
The Y position of this rectangle, in screen pixels.
The documentation for this struct was generated from the following file: