ctx1.shadowColor="rgba(203,91,0,1)";这个阴影可以看出不是黑色的,但这个ctx1.fillStyle="rgba(203,91,0,"+alpha+")";圈是黑色的,什么问题?
haloObj.prototype.draw=function(){ ctx1.save(); ctx1.lineWidth=2; ctx1.shadowBlur=10; ctx1.shadowColor="rgba(203,91,0,1)"; for(var i=0;i<this.num;i++){ if(this.alive[i]){ this.r[i]+=deltaTime*0.05; if(this.r[i]>50){ this.alive[i]=false; continue; } var alpha=1-this.r[i]/50; ctx1.beginPath(); ctx1.arc(this.x[i],this.y[i],this.r[i],0,Math.PI*2); ctx1.closePath(); ctx1.fillStyle="rgba(203,91,0,"+alpha+")"; ctx1.stroke(); } } ctx1.restore(); }
慕瓜9220888
锋君
Jayming
相关分类