This class defines a rectangle in two-dimensional geometric space. It is used to represent the area in projected space.
| Name | Type | Description |
|---|---|---|
left |
number |
An x-value indicating the left edge of the rectangle |
top |
number |
A y-value indicating the top edge of the rectangle |
right |
number |
An x-value indicating the right edge of the rectangle |
bottom |
number |
A y-value indicating the bottom edge of the rectangle |
Members
-
This property holds a y-value indicating the bottom edge of the rectangle.
-
This property holds an x-value indicating the left edge of the rectangle.
-
This property holds an x-value indicating the right edge of the rectangle.
-
This property holds a y-value indicating the top edge of the rectangle.
Methods
-
H.math.Rect.fromPoints (topLeft, bottomRight)H.math.Rect static
-
This method creates a rectangle from a top-left and bottom-right point pair.
Name Type Description topLeftH.math.IPoint The top-left vertex of the rectangle
bottomRightH.math.IPoint The bottom-right vertex of the rectangle
Returns:
Type Description H.math.Rect The rectangular area defined by its top-left and bottom-right vertices -
clone ()H.math.Rect
-
This method clones the given rectangle.
Returns:
Type Description H.math.Rect An object representing the newly clone rectangle -
This method checks if the provided coordinates lie within the rectangle.
Name Type Description xnumber The value of the x-coordinate to check
ynumber The value of the y-coordinate to check
Returns:
Type Description boolean trueif the coordinates lie within the rectangle,falseif the parameters are isNaN -
getBottomRight ()H.math.Point
-
This method retrieves the bottom-right vertex of the rectangle.
Returns:
Type Description H.math.Point An object containing the screen coordinates of the bottom-right vertex of the rectangle -
getTopLeft ()H.math.Point
-
This method retrieves the top-left vertex of the rectangle.
Returns:
Type Description H.math.Point An object containing the screen coordinates of the top-left vertex of the rectangle -
This method sets the values of the edges of the rectangle.
Name Type Description leftnumber An x-value indicating the left edge of the rectangle
topnumber A y-value indicating the top edge of the rectangle
rightnumber An x-value indicating the right edge of the rectangle
bottomnumber A y-value indicating the bottom edge of the rectangle