Summary

Represents a rectangle but with whole numbers

Constructors

RectInt Initialize a Rect at given position and with given size.

Properties

Bottom Position of rect's bottom edge relative to its parent.
BottomLeft Position of the bottom left edge of this rect.
BottomRight Position of the bottom right edge of this rect.
Center Center of this rect.
Height Height of the rect.
Left Position of rect's left edge relative to its parent, can also be interpreted as its position on the X axis.
Position Position of this rect.
Right Position of rect's right edge relative to its parent.
Size Size of this rect.
Top Position of rect's top edge relative to its parent, can also be interpreted as its position on the Y axis.
TopLeft Position of the top left edge of this rect.
TopRight Position of the top right edge of this rect.
Width Width of the rect.
WithoutPosition Returns this rect with position set to 0 on both axes.

Methods

Add Expand this Rect to contain the other rect
AddPoint Returns this rect expanded to include this point
Grow Returns a Rect grown in every direction by given amounts.
IsInside Return true if the passed rect is partially or fully inside this rect.
Shrink Returns a Rect shrunk in every direction by given values.

Static Methods

FromPoints Create a rect between two points. The order of the points doesn't matter.
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.