Methods
-
<static> fillPolygon(context, vertices, offsetX, offsetY, scale)
-
Fills a polygon defined by vertices in context. IMPORTANT: this method assumes the context's fillStyle is already set!
Parameters:Name Type Argument Default Description contextCanvasRenderingContext2D context to draw into. verticesArray polygon vertices. offsetXNumber <optional>
0 x offset. offsetYNumber <optional>
0 y offset. scaleNumber <optional>
1 scale after offset. - Source:
-
<static> fillRoundedRect(context, x, y, width, height, radius)
-
Fills a rounded rectangle in context. IMPORTANT: this method assumes the context's fillStyle is already set!
Parameters:Name Type Description contextCanvasRenderingContext2D xNumber top left x position yNumber top left y position widthNumber rect width heightNumber rect height radiusNumber corner radius - Source:
-
<static> pixelFillPolygon(context, minX, minY, maxX, maxY, vertices, r, g, b, a, add, boundsVertices, stabilize)
-
Pixel perfectly fills a polygon defined by vertices in context with r, g, b, a (optionally, add color instead of set color).
Parameters:Name Type Argument Default Description contextCanvasRenderingContext2D context to draw into. minXNumber left position of bounds minYNumber top position of bounds maxXNumber right position of bounds maxYNumber bottom position of bounds verticesArray polygon vertices, in absolute or relative coordinates. rNumber red. gNumber green. bNumber blue. aNumber alpha. addBoolean <optional>
false add to existing color. boundsVerticesObject <optional>
boundsContext bounds of polygon. stabilizeBoolean <optional>
true whether to stabilize for rounding error. - Source:
-
<static> pixelFillRoundedRect(context, boundsContext, minX, minY, maxX, maxY, x, y, width, height, radius, r, g, b, a, precision, add, stabilize)
-
Pixel perfectly fills a rounded rectangle in context.
Parameters:Name Type Argument Default Description contextCanvasRenderingContext2D boundsContextObject bounds of context to draw into. minXNumber left position of bounds minYNumber top position of bounds maxXNumber right position of bounds maxYNumber bottom position of bounds xNumber top left x position yNumber top left y position widthNumber rect width heightNumber rect height radiusNumber corner radius rNumber red. gNumber green. bNumber blue. aNumber alpha. precisionNumber <optional>
dynamic precision of curves in number of vertices. addBoolean <optional>
false add to existing color. stabilizeBoolean <optional>
true whether to stabilize for rounding error. - Source:

Impact++