Struct IntRectangle
- Namespace
- Lime
- Assembly
- Lime.dll
Representation of integer 2D rectangles.
public struct IntRectangle : IEquatable<IntRectangle>
- Implements
- Inherited Members
Constructors
IntRectangle(IntVector2, IntVector2)
public IntRectangle(IntVector2 a, IntVector2 b)
Parameters
a
IntVector2b
IntVector2
IntRectangle(int, int, int, int)
public IntRectangle(int left, int top, int right, int bottom)
Parameters
Fields
A
Left-top corner of this rectangle.
[YuzuMember("0")]
public IntVector2 A
Field Value
B
Right-bottom corner of this rectangle.
[YuzuMember("1")]
public IntVector2 B
Field Value
Remarks
Rectangle doesn't contain this point.
Empty
Returns a rectangle with both corners in 0, 0.
public static readonly IntRectangle Empty
Field Value
Properties
Bottom
public int Bottom { get; set; }
Property Value
Center
public IntVector2 Center { get; }
Property Value
Height
public int Height { get; set; }
Property Value
this[int]
public int this[int component] { get; set; }
Parameters
component
int
Property Value
Left
public int Left { get; set; }
Property Value
Normalized
Returns this rectangle with swapped coordinates of borders if width or height is negative.
public IntRectangle Normalized { get; }
Property Value
Remarks
Width or height can be negative if coordinates of borders are mixed up. This property returns new IntRectangle with width and height that are guaranteed to be positive.
Right
public int Right { get; set; }
Property Value
Size
public IntVector2 Size { get; }
Property Value
Top
public int Top { get; set; }
Property Value
Width
public int Width { get; set; }
Property Value
Methods
Contains(IntVector2)
public bool Contains(IntVector2 value)
Parameters
value
IntVector2
Returns
Equals(IntRectangle)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(IntRectangle other)
Parameters
other
IntRectangleAn object to compare with this object.
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object obj)
Parameters
obj
objectThe object to compare with the current instance.
Returns
- bool
true if
obj
and this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
Intersect(IntRectangle, IntRectangle)
Creates a new IntRectangle that contains overlapping region of two other rectangles.
public static IntRectangle Intersect(IntRectangle value1, IntRectangle value2)
Parameters
value1
IntRectanglevalue2
IntRectangle
Returns
OffsetBy(IntVector2)
Creates a new IntRectangle that has coordinates of this rectangle shifted by specified value.
public IntRectangle OffsetBy(IntVector2 value)
Parameters
value
IntVector2
Returns
ToString()
Returns the string representation of this IntRectangle in the format: "A.X, A.Y, B.X, B.Y".
public override string ToString()
Returns
Operators
operator ==(IntRectangle, IntRectangle)
public static bool operator ==(IntRectangle lhs, IntRectangle rhs)
Parameters
lhs
IntRectanglerhs
IntRectangle
Returns
explicit operator Rectangle(IntRectangle)
public static explicit operator Rectangle(IntRectangle value)
Parameters
value
IntRectangle
Returns
explicit operator WindowRect(IntRectangle)
public static explicit operator WindowRect(IntRectangle value)
Parameters
value
IntRectangle
Returns
operator !=(IntRectangle, IntRectangle)
public static bool operator !=(IntRectangle lhs, IntRectangle rhs)
Parameters
lhs
IntRectanglerhs
IntRectangle