Polygon Class
This shape represents a 2D polygon.
Constructor
Polygon
()
Item Index
Methods
Methods
addVertex
(
-
x
-
y
The positions of the vertices should be defined IN RELATION TO THE CENTER OF THE POLYGON. All vertices should be ADDED IN CLOCKWISE ORDER taking into account the coordinate system used by the engine.
Parameters:
-
x
NumberThe vertex's x coordinate.
-
y
NumberThe vertex's y coordinate.
clearVertices
()
Clears the vertex array.
getVertices
()
Array
Returns the vertices of the polygon. Doesn't copy. Handle with care.
Returns:
Array:
Vertices of the polygon.