Skip to content

Move To

The moveTo() method sets the starting point of a path.

ParameterDescription
xThe x coordinate of the target location of the path.
yThe y coordinate of the target position of the path.

Example

ts
const ctx = node.getComponent(Graphics);
ctx.moveTo(0,0);
ctx.lineTo(300,150);
ctx.stroke();

moveTo.png


Return to the Graphics Component Reference documentation.