this.graphics = new annie.Shape(); ... ...
var line = this.graphics;
line.beginStroke( "#ffffff", 10,1,2);
line.moveTo(30,60);
line.lineTo(120,80);
line.endStroke();//换个颜色...
this.graphics = new annie.Shape();
... ...
var line = this.graphics;
line.beginStroke( "#ffffff", 10,1,2);
line.moveTo(30,60);
line.lineTo(120,80);
line.endStroke();
//换个颜色继续画贝塞尔曲线虚线
line.setLineDash([10, 15]); //设置虚线参数:(虚线长度,虚线间隔)
line.beginStroke( "#ffcc00",9);
line.moveTo(120,80);
line.quadraticCurveTo(700,330,900,630); //绘制一条二次贝塞尔曲线 ( 控制点X, 控制点Y, 终点X, 终点Y )
line.endStroke();
//怎么调整回实线,这样?:
我尝试了了一下。
就算是在line.endStroke();之后,重新line.beginStroke(...)画线,也是虚线。
不过这么设置,也算是实线了:line.setLineDash([10000, 0]); //设置虚线参数:(虚线长度,虚线间隔)
//群里allen提醒我,源码里面有提示,设为 []就可以清除虚线,变为实线
-------------------------------------------------------------------------------------------
line.setLineDash([]); // []清除虚线,变为实线
line.beginStroke( "#55cc00",25,1,2);
line.moveTo(450, 360); //绘画时移动到某一点
line.lineTo(900,360); //
line.endStroke(); //结束画线