CanvasContext.moveTo

Move the path to the specified point, the line will not be created. stroke() can be used to draw the line.

Parameters

It is Object type.

PropertyTypeDescription
xNumberThe x coordinate of the destination point.
yNumberThe y coordinate of the destination point.

Sample Code

copy
//.js
const ctx = my.createCanvasContext('awesomeCanvas')
ctx.moveTo(10, 10)
ctx.lineTo(100, 10)

ctx.moveTo(10, 50)
ctx.lineTo(100, 50)
ctx.stroke()
ctx.draw()