为啥我的海葵的高度和背景图片一样高~~~~~~
aneObj.prototype.draw=function () {
for(var i=0;i<this.num;i++){
//begin moveto lineto stroke strokestyle linewigth linecap globalAlpha closepath
ctx2.beginPath();//海葵绘制在canvas2上
ctx2.moveTo(this.x[i],canHeight);//绘制起始点 x y
ctx2.lineTo(this.x[i],canHeight-this.len[i]);
ctx2.strokeStyle="purple";//紫色 在stroke之前
ctx2.stroke();//首先告诉笔触颜色 才能用stroke画
ctx2.lineWidth=10;
ctx2.lineCap="round";
ctx2.globalAlpha=0.6;
ctx2.closePath();
}
};我也是海葵的高度和背景图片一样高~~~~~~
最好是贴代码,感觉是你绘制海葵上面出现问题,lineTo()参数看是不是有误