This Class was originally created to draw extra shapes but it is not used in this version currently
- Source:
Methods
(static) drawArrow(_cntx, _x, _y, _angle, _type, _fillColor, _strokeColor) → {Object}
This Function draws arrow head into canvas for a given coordinates
Parameters:
| Name | Type | Description |
|---|---|---|
_cntx |
2D_Context | |
_x |
Number | |
_y |
Number | |
_angle |
Number | |
_type |
String | (type of arrows - Regular, Filled, Hollow, DiamondFilled, DiamondHollow, Dot |
_fillColor |
Color | |
_strokeColor |
Color |
- Source:
Returns:
- - containing coordinates {x1,x2,y1,y2}
- Type
- Object
(static) drawEllipse(_ctx, _cx, _cy, _rx, _ry, _fill, _stroke)
This Function draws ellipse into canvas context
Parameters:
| Name | Type | Description |
|---|---|---|
_ctx |
2D_Context | |
_cx |
Number | center of ellipse |
_cy |
Number | center of ellipse |
_rx |
Number | x radius of ellipse |
_ry |
Number | y radius of ellipse |
_fill |
Color | |
_stroke |
Color |
- Source:
Returns:
- nothing
(static) drawLines(_ctx, _offsetX, _offsetY, _d, _fill, _stroke)
This Function draws multiple lines into canvas context
Parameters:
| Name | Type | Description |
|---|---|---|
_ctx |
2D_Context | |
_offsetX |
Number | offset any X coordinate by this number |
_offsetY |
Number | offset any Y coordinate by this number |
_d |
String | contains d parameter as used in SVG Path |
_fill |
Color | |
_stroke |
Color |
- Source:
Returns:
- nothing
(static) getArrowHead(_x, _y, _angle) → {Object}
This Function coordinates for arrow head
Parameters:
| Name | Type | Description |
|---|---|---|
_x |
Number | |
_y |
Number | |
_angle |
Number | in radian |
- Source:
Returns:
- - containing coodinates {x1,x2,y1,y2}
- Type
- Object
(static) getLineAngle(x2, y2, x1, y1) → {Number}
This Function returns angle between two points
Parameters:
| Name | Type | Description |
|---|---|---|
x2 |
Number | |
y2 |
Number | |
x1 |
Number | |
y1 |
Number |
- Source:
Returns:
- angle in radian
- Type
- Number
(static) roundRect(cntx, x, y, width, height, radius, fill, stroke)
This Function draws rounded corner rectangle into canvas context
Parameters:
| Name | Type | Description |
|---|---|---|
cntx |
2D_Context | |
x |
Number | |
y |
Number | |
width |
Number | |
height |
Number | |
radius |
Number | |
fill |
Color | |
stroke |
Color |
- Source:
Returns:
- nothing