new ludo.svg.Polyline(points, config)
Class for drawing polylines.
Parameters:
Name | Type | Description |
---|---|---|
points |
String | |
config |
canvas.NodeConfig |
- Source:
Example
var polyline = new ludo.svg.Polyline('20,20 40,25 60,40 80,120 120,140 200,180');
Extends
- canvas.NamedNode
Methods
-
getPoint(index) → {Object|undefined}
-
Return x and y of a point
Parameters:
Name Type Description index
Number - Source:
Returns:
x and y
- Type
- Object | undefined
-
getPosition() → {Object}
-
Get position of polyline, min X and min Y)
- Source:
Returns:
x and y
- Type
- Object
-
getSize() → {Object}
-
Get size of polyline (max X - min X) and (max X - min Y)
- Source:
Returns:
x and y
- Type
- Object
-
setPoint(index, x, y)
-
Set new x and y for one of the points.
Parameters:
Name Type Description index
Number x
Number y
Number - Source:
Examples
var polyline = new ludo.svg.Polyline('20,20 40,25 60,40 80,120 120,140 200,180'); polyline.setPoint(0,10,5); polyline.setPoint(1,120,40); will change the points to
'10,5 120,40 60,40 80,120 120,140 200,180'