new DrawablePolygon(owner, canvasBitmap, pointsopt, argsopt) → {void}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
owner |
GameEntity | |||
canvasBitmap |
object | |||
points |
object |
<optional> |
[] | |
args |
object |
<optional> |
{} |
Properties:
Name | Type | Description |
---|---|---|
points |
object |
the set of points defining a convex polygon |
drawLevels |
integer |
The number of frames before the polygon is completely finished |
drawModeMask |
integer |
Draw mode for the polygon, bitmask of: ' 1 wireframe (just edges of triangles) ' 2 fill (render with rectangles) ' 4 rays (render with rays) |
tempCanvas |
object | |
lastPoints |
object | |
triangles |
object | |
hulledPoints |
object | |
lastDrawMode |
integer | |
currentDrawLevel |
integer | |
minimumFrameRateTarget |
integer | |
maxDrawLevels |
integer |
Extends
- DrawableWithOutline
Methods
draw(additionalRotationopt) → {void}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
additionalRotation |
float |
<optional> |
0 |
drawTriangleEdges(tri) → {void}
Draw a triangle edges - uses outlineRGBA if drawOutline is true
Parameters:
Name | Type | Description |
---|---|---|
tri |
object |
an array with 3 {x,y} points |
fillPolygonWithRectangles(pointsopt, levelOfDetailopt, levelOffsetopt) → {void}
Draw a filled convex polygon with rectangles
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
points |
object |
<optional> |
[] |
an array of {x,y} points |
levelOfDetail |
integer |
<optional> |
1 |
How many steps it should take to get a crisp polygon |
levelOffset |
integer |
<optional> |
0 |
which step of the fill should be done (0-levelOfDetail) |
fillTriangleWithRays(triopt, levelOfDetailopt, levelOffsetopt) → {void}
Draw a filled triangle with rays from the apex ato the shortest side of the triangle
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
tri |
object |
<optional> |
[] |
an array with 3 {x,y} points |
levelOfDetail |
integer |
<optional> |
1 |
LOD of the triangle - how filled in it should be |
levelOffset |
integer |
<optional> |
0 |
which step of teh fill should be done (0-levelOfDetail) |