Loading...
Constructor
Creates a new rectangle.
Arguments
1. Default rectangle (0, 0 position; 0, 0 size).
None.
2. Single value.
3. Single vector.
4. Double value.
5. Double vector.
6. Four values.
Returns
Example
Field
Mins (top-left) vector.
Field
Maxs (bottom-right) vector.
Method
Either returns rectangle's width, or sets a new width.
Arguments
1. Get width.
None.
2. Set width.
Returns
1. Get width.
float
Width.
2. Set width.
rect
New rectangle with changed width.
Example
Method
Either returns rectangle's height, or sets a new height.
Arguments
1. Get height.
None.
2. Set height.
value
float
New height.
Returns
1. Get height.
float
Height.
2. Set height.
rect
New rectangle with changed height.
Example
Method
Either returns rectangle's size, or sets a new size.
Arguments
1. Get size.
None.
2. Set size.
value
New size.
Returns
1. Get size.
Size.
2. Set size.
rect
New rectangle with changed size.
Example
Method
Explodes the rectangle by given vector (increase size from center into all directions by coordinates in the vector).
Arguments
value
Explode size.
Returns
rect
Exploded rectangle.
Example
Method
Returns a rectangle with half of the width of this rectangle.
Arguments
None.
Returns
rect
Rectangle with halved width.
Example
Method
Translates (moves) this rectangle by vector coordinates.
Arguments
value
Translation amount.
Returns
rect
Translated rectangle.
Example
Method
Move rectangle from the left by given amount.
Arguments
value
float
Margin amount.
Returns
rect
Moved rectangle.
Example
Method
Move rectangle from the right by given amount.
Arguments
value
float
Margin amount.
Returns
rect
Moved rectangle.
Example
Method
Move rectangle from the top by given amount.
Arguments
value
float
Margin amount.
Returns
rect
Moved rectangle.
Example
Method
Move rectangle from the bottom by given amount.
Arguments
value
float
Margin amount.
Returns
rect
Moved rectangle.
Example
Method
Adds the value to the left side of the rectangle.
Arguments
value
float
Padding amount.
Returns
rect
Resized rectangle.
Example
Method
Adds the value to the right side of the rectangle.
Arguments
value
float
Padding amount.
Returns
rect
Resized rectangle.
Example
Method
Adds the value to the top side of the rectangle.
Arguments
value
float
Padding amount.
Returns
rect
Resized rectangle.
Example
Method
Adds the value to the bottom side of the rectangle.
Arguments
value
float
Padding amount.
Returns
rect
Resized rectangle.
Example
Method
Shrinks (implodes) the rectangle by given amount.
Arguments
value
float
Shrink value.
Returns
rect
Resized rectangle.
Example
Method
Expands (explodes) the rectangle by given amount.
Arguments
value
float
Expand value.
Returns
rect
Resized rectangle.
Example
Method
Returns true
if this rectangle contains either vector or another rectangle.
Arguments
1. Vector variant.
other
Vector to check against.
2. Rectangle variant.
other
rect
Rectangle to check against.
Returns
bool
true
if other object is in bounds of this rectangle.
Example
Method
Returns true
if the other rectangle overlaps with this rectangle.
Arguments
other
rect
Rectangle to check against.
Returns
bool
true
if other rectangle overlaps with this rectangle.
Example
Method
Intersects this rectangle with another rectangle.
Arguments
other
rect
Rectangle to intersect with.
Returns
rect
Intersected rectangle.
Example
Method
Returns top-left vector.
Arguments
None.
Returns
Top-left vector.
Example
Method
Returns top-right vector.
Arguments
None.
Returns
Top-right vector.
Example
Method
Returns bottom-right vector.
Arguments
None.
Returns
Bottom-right vector.
Example
Method
Returns bottom-left vector.
Arguments
None.
Returns
Bottom-left vector.
Example
Method
Returns center point of this rectangle.
Arguments
None.
Returns
Center point.
Example
Method
Treats this rectangle as an ellipsis and returns point on it. Note, that this "ellipsis" will be perfect with no modified curvature (basically if this rectangle is a box - you will get a point on a perfect circle).
Arguments
r
float
Radians value.
Returns
Point on the ellipsis.
Example
Method
Returns floored rectangle.
Arguments
None.
Returns
rect
Floored rectangle.
Example
Method
Returns ceiled rectangle.
Arguments
None.
Returns
rect
Ceiled rectangle.
Example
Method
Returns rounded rectangle.
Arguments
None.
Returns
rect
Rounded rectangle.
Example
Method
Returns true
if both mins and maxs are equal to 0.
Arguments
None.
Returns
bool
true
if this is a zero rectangle.
Example
Loading...
Loading...
Loading...