Class Polygon
Defined in: primitives.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Polygon()
Creates an instance of a Polygon
|
Field Attributes | Field Name and Description |
---|---|
Serialization type
|
|
An {Array} of Points
|
|
The Style of the polygon
|
Method Attributes | Method Name and Description |
---|---|
addPoint(point)
|
|
clone()
|
|
contains(x, y)
|
|
equals(anotherPolygon)
|
|
fill(context, color)
|
|
<static> |
Polygon.load(o)
Creates a {Polygon} out of JSON parsed object
|
near(x, y, radius)
|
|
paint(context)
|
|
toString()
|
|
toSVG()
Render the SVG fragment for this primitive
|
|
transform(matrix)
|
Field Detail
oType
Serialization type
points
An {Array} of Points
style
The Style of the polygon
Method Detail
addPoint(point)
- Parameters:
- point
clone()
contains(x, y)
- Parameters:
- x
- y
equals(anotherPolygon)
- Parameters:
- anotherPolygon
fill(context, color)
- Parameters:
- context
- color
{Array}
getBounds()
- Returns:
- {Array
} - returns [minX, minY, maxX, maxY] - bounds, where all points are in the bounds.
getPoints()
getPosition()
<static>
{Polygon}
Polygon.load(o)
Creates a {Polygon} out of JSON parsed object
Author: Alex Gheorghiu.
Author: Alex Gheorghiu
- Parameters:
- {JSONObject} o
- - the JSON parsed object
- Returns:
- {Polygon} a newly constructed Polygon
near(x, y, radius)
- Parameters:
- x
- y
- radius
paint(context)
- Parameters:
- context
toString()
toSVG()
Render the SVG fragment for this primitive
transform(matrix)
- Parameters:
- matrix