rect
__callīģŋ
Constructor
Creates a new rectangle.
Arguments
1. Default rectangle (0, 0 position; 0, 0 size).
None.
2. Single value.
value
float
Mins XY, maxs XY value.
3. Single vector.
value
Mins vector, maxs vector.
4. Double value.
x
float
Mins/maxs X coordinate.
y
float
Mins/maxs Y coordinate.
5. Double vector.
mins
Mins vector.
maxs
Maxs vector.
6. Four values.
x0
float
Mins X coordinate.
y0
float
Mins Y coordinate.
x1
float
Maxs X coordinate.
y1
float
Maxs Y coordinate.
Returns
rect
New rectangle.
Example
minsīģŋ
Field
Mins (top-left) vector.
maxsīģŋ
Field
Maxs (bottom-right) vector.
widthīģŋ
Method
Either returns rectangle's width, or sets a new width.
Arguments
1. Get width.
None.
2. Set width.
value
float
New width.
Returns
1. Get width.
float
Width.
2. Set width.
rect
New rectangle with changed width.
Example
heightīģŋ
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
sizeīģŋ
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
explodeīģŋ
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
half_widthīģŋ
Method
Returns a rectangle with half of the width of this rectangle.
Arguments
None.
Returns
rect
Rectangle with halved width.
Example
translateīģŋ
Method
Translates (moves) this rectangle by vector coordinates.
Arguments
value
Translation amount.
Returns
rect
Translated rectangle.
Example
margin_leftīģŋ
Method
Move rectangle from the left by given amount.
Arguments
value
float
Margin amount.
Returns
rect
Moved rectangle.
Example
margin_rightīģŋ
Method
Move rectangle from the right by given amount.
Arguments
value
float
Margin amount.
Returns
rect
Moved rectangle.
Example
margin_topīģŋ
Method
Move rectangle from the top by given amount.
Arguments
value
float
Margin amount.
Returns
rect
Moved rectangle.
Example
margin_bottomīģŋ
Method
Move rectangle from the bottom by given amount.
Arguments
value
float
Margin amount.
Returns
rect
Moved rectangle.
Example
padding_leftīģŋ
Method
Adds the value to the left side of the rectangle.
Arguments
value
float
Padding amount.
Returns
rect
Resized rectangle.
Example
padding_rightīģŋ
Method
Adds the value to the right side of the rectangle.
Arguments
value
float
Padding amount.
Returns
rect
Resized rectangle.
Example
padding_topīģŋ
Method
Adds the value to the top side of the rectangle.
Arguments
value
float
Padding amount.
Returns
rect
Resized rectangle.
Example
padding_bottomīģŋ
Method
Adds the value to the bottom side of the rectangle.
Arguments
value
float
Padding amount.
Returns
rect
Resized rectangle.
Example
shrinkīģŋ
Method
Shrinks (implodes) the rectangle by given amount.
Arguments
value
float
Shrink value.
Returns
rect
Resized rectangle.
Example
expandīģŋ
Method
Expands (explodes) the rectangle by given amount.
Arguments
value
float
Expand value.
Returns
rect
Resized rectangle.
Example
containsīģŋ
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
overlapsīģŋ
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
intersectīģŋ
Method
Intersects this rectangle with another rectangle.
Arguments
other
rect
Rectangle to intersect with.
Returns
rect
Intersected rectangle.
Example
tlīģŋ
Method
Returns top-left vector.
Arguments
None.
Returns
Top-left vector.
Example
trīģŋ
Method
Returns top-right vector.
Arguments
None.
Returns
Top-right vector.
Example
brīģŋ
Method
Returns bottom-right vector.
Arguments
None.
Returns
Bottom-right vector.
Example
blīģŋ
Method
Returns bottom-left vector.
Arguments
None.
Returns
Bottom-left vector.
Example
centerīģŋ
Method
Returns center point of this rectangle.
Arguments
None.
Returns
Center point.
Example
circleīģŋ
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
floorīģŋ
Method
Returns floored rectangle.
Arguments
None.
Returns
rect
Floored rectangle.
Example
ceilīģŋ
Method
Returns ceiled rectangle.
Arguments
None.
Returns
rect
Ceiled rectangle.
Example
roundīģŋ
Method
Returns rounded rectangle.
Arguments
None.
Returns
rect
Rounded rectangle.
Example
is_zeroīģŋ
Method
Returns true
if both mins and maxs are equal to 0.
Arguments
None.
Returns
bool
true
if this is a zero rectangle.
Example
Last updated