moveTo
moveTo() 用于表示一条路径的起点。
| 参数 | 描述 |
|---|---|
| x | 路径的目标位置的 x 坐标 |
| y | 路径的目标位置的 y 坐标 |
实例
var ctx = node.getComponent(cc.Graphics);
ctx.moveTo(0, 0);
ctx.lineTo(300, 150);
ctx.fill();
moveTo() 用于表示一条路径的起点。
| 参数 | 描述 |
|---|---|
| x | 路径的目标位置的 x 坐标 |
| y | 路径的目标位置的 y 坐标 |
var ctx = node.getComponent(cc.Graphics);
ctx.moveTo(0, 0);
ctx.lineTo(300, 150);
ctx.fill();