阅读(1936) (42)

Cax 内置 Graphics

2018-06-21 11:14:11 更新

绘图对象,用于使用基本的连缀方式的 Canvas 指令绘制图形。

const graphics = new cax.Graphics()
graphics
    .beginPath()
    .arc(0, 0, 10, 0, Math.PI * 2)
    .closePath()
    .fillStyle('#f4862c')
    .fill()
    .strokeStyle('black')
    .stroke()


graphics.x = 100
graphics.y = 200


stage.add(graphics)