new Polygon(points_)
Parameters:
Name | Type | Description |
---|---|---|
points_ |
Array.<Vector> | Array.<number> | Vector | number | This can be an array of Points that form the polygon, |
- Source:
Members
-
points :Array.<number>
-
An array of the points of this polygon
Type:
- Array.<number>
- Source:
-
type :number
-
The type of the object, mainly used to avoid
instanceof
checksType:
- number
- Source:
Methods
-
clone()
-
Creates a clone of this polygon
- Source:
Returns:
a copy of the polygon
- Type
- Polygon
-
contains(x, y)
-
Checks whether the x and y coordinates passed to this function are contained within this polygon
Parameters:
Name Type Description x
number The X coordinate of the point to test
y
number The Y coordinate of the point to test
- Source:
Returns:
Whether the x/y coordinates are within this polygon
- Type
- boolean