canvas.Polygon Class
Class for drawing polygons.
Constructor
canvas.Polygon
(
-
points
-
config
Parameters:
-
points
String -
config
canvas.NodeConfig
Example:
var polyline = new ludo.canvas.Polygon('20,20 40,25 60,40 80,120 120,140 200,180');
Item Index
Methods
Methods
getPoint
(
Object | Undefined
-
index
Return x and y of a point
Parameters:
-
index
Number
Returns:
Object | Undefined:
x and y
setPoint
(
-
index
-
x
-
y
Set new x and y for one of the points.
Example:
var polyline = new ludo.canvas.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'