Class: Polygon

Grape2D. Polygon

new Polygon()

Polygon describes a polygon shape. A list of vertexes should should be provided or set afterwards.
Parameters:
Name Type Argument Description
options.position Grape2D.Vector <optional>
The position of the polygon
options.vertexList !Array.<!Grape2D.Vector> A list with the vertexes of the polygon. They're position should be relative to the position. This means that a vertex at (0,0) is at the same position that polygon.getPosition().
Source:

Extends

Members

<private, static> TYPE :string

Type of the shape.
Type:
  • string
Source:

<private> computedVertexList :!Array.<!Grape2D.Vector>

Polygon's vertexes. Relative to the world.
Type:
Source:

<protected> position :Grape2D.Vector

Shape's position.
Type:
Inherited From:
Source:

<private> vertexList :!Array.<!Grape2D.Vector>

Polygon's vertexes.
Type:
Source:

Methods

<protected> computeVertexList()

Computes the original vertex coordinates, to be relative to the world position.
Source:

createBV()

Source:

getComputedVertexList() → {!Array.<!Grape2D.Vector>}

Gets the vertex list relative to the world.
Source:
Returns:
Array with the vertexes.
Type
!Array.<!Grape2D.Vector>

getPosition() → {Grape2D.Vector}

Gets the position of the object.
Inherited From:
Source:
Returns:
The center position of the shape.
Type
Grape2D.Vector

getStaticType()

Source:

getVertexList() → {!Array.<!Grape2D.Vector>}

Gets the list of vertexes.
Source:
Returns:
The array with the vertexes.
Type
!Array.<!Grape2D.Vector>

render()

Source:

setPosition()

Source:

setVertexList(vertexList)

Sets a list of vertexes.
Parameters:
Name Type Description
vertexList !Array.<!Grape2D.Vector> A list with the new vertexes.
Source: