Begin a path, move to position 0,0. Create a line to position 300,150:
JavaScript:
Internet Explorer 9, Firefox, Opera, Chrome, and Safari support the moveTo() method.
Note: Internet Explorer 8 and earlier versions, do not support the <canvas> element.
The moveTo() method moves the path to the specified point in the canvas, without creating a line.
Tip: Use the stroke() method to actually draw the path on the canvas.
JavaScript syntax: | context.moveTo(x,y); |
---|
Parameter | Description | Play it |
---|---|---|
x | The x-coordinate of where to move the path to | Play it » |
y | The y-coordinate of where to move the path to | Play it » |