IntRectangle
Namespace: Murder.Core.Geometry
Assembly: Murder.dll
public sealed struct IntRectangle : IEquatable<T>
Implements: IEquatable<T>
⭐ Constructors
public IntRectangle(Point p, int width, int height)
Parameters
p
Point
width
int
height
int
public IntRectangle(Point position, Point size)
Parameters
position
Point
size
Point
public IntRectangle(float x, float y, float width, float height)
Parameters
x
float
y
float
width
float
height
float
public IntRectangle(int x, int y, int width, int height)
Parameters
x
int
y
int
width
int
height
int
⭐ Properties
Bottom
public int Bottom { get; }
Returns
int
BottomLeft
public Point BottomLeft { get; }
Returns
Point
BottomRight
public Point BottomRight { get; }
Returns
Point
Center
public Vector2 Center { get; }
Returns
Vector2
CenterPoint
public Point CenterPoint { get; }
Returns
Point
Empty
public static IntRectangle Empty { get; }
Returns
IntRectangle
Height
public int Height;
Returns
int
Left
public int Left { get; }
Returns
int
One
public static IntRectangle One { get; }
Returns
IntRectangle
Right
public int Right { get; }
Returns
int
Size
public Point Size { get; public set; }
Returns
Point
Top
public int Top { get; }
Returns
int
TopLeft
public Point TopLeft { get; }
Returns
Point
TopRight
public Point TopRight { get; }
Returns
Point
Width
public int Width;
Returns
int
X
public int X;
Returns
int
Y
public int Y;
Returns
int
⭐ Methods
Contains(Point)
public bool Contains(Point point)
Parameters
point
Point
Returns
bool
Contains(Rectangle)
public bool Contains(Rectangle other)
Parameters
other
Rectangle
Returns
bool
Contains(float, float)
public bool Contains(float X, float Y)
Returns
bool
Contains(int, int)
public bool Contains(int X, int Y)
Returns
bool
Touches(Rectangle)
public bool Touches(Rectangle other)
Gets whether or not the other Rectangle intersects with this rectangle.
Parameters
other
Rectangle
Returns
bool
TouchesInside(Rectangle)
public bool TouchesInside(Rectangle other)
Gets whether or not the other Rectangle intersects with this rectangle.
Parameters
other
Rectangle
Returns
bool
AddPosition(Point)
public IntRectangle AddPosition(Point position)
Parameters
position
Point
Returns
IntRectangle
AddPosition(Vector2)
public IntRectangle AddPosition(Vector2 position)
Parameters
position
Vector2
Returns
IntRectangle
CenterRectangle(Vector2, float, float)
public IntRectangle CenterRectangle(Vector2 center, float width, float height)
Parameters
center
Vector2
width
float
height
float
Returns
IntRectangle
Expand(float)
public IntRectangle Expand(float value)
Parameters
value
float
Returns
IntRectangle
Expand(int)
public IntRectangle Expand(int value)
Parameters
value
int
Returns
IntRectangle
Expand(int, int)
public IntRectangle Expand(int x, int y)
Returns
IntRectangle
FromCoordinates(Point, Point)
public IntRectangle FromCoordinates(Point topLeft, Point bottomRight)
Parameters
topLeft
Point
bottomRight
Point
Returns
IntRectangle
FromCoordinates(int, int, int, int)
public IntRectangle FromCoordinates(int top, int bottom, int left, int right)
Parameters
top
int
bottom
int
left
int
right
int
Returns
IntRectangle
ClampPosition(IntRectangle)
public Point ClampPosition(IntRectangle innerRect)
Parameters
innerRect
IntRectangle
Returns
Point
Clamp(Vector2)
public Vector2 Clamp(Vector2 point)
Parameters
point
Vector2
Returns
Vector2
Equals(IntRectangle)
public virtual bool Equals(IntRectangle other)
Parameters
other
IntRectangle
Returns
bool
Equals(Object)
public virtual bool Equals(Object obj)
Parameters
obj
Object
Returns
bool
GetHashCode()
public virtual int GetHashCode()
Returns
int
ToString()
public virtual string ToString()
Returns
string
⚡