關于在ctx1上添加陰影的問題(含圖片 代碼)
我在ctx1上添加了陰影效果后?
為什么整個畫布的每一個都有了陰影 包括ctx2上也有了 ??
ctx1.save();
ctx1.shadowBlur= 10;
ctx1.shadowColor ='#fff';
ctx1.textAlign = 'center';
ctx1.font = "bold 50px serif";
ctx1.fillText("Score:"+this.score,canWidth/2,70);
if(this.gameOver){
this.alpha += deltaTime * 0.0005;
if(this.alpha > 1){
this.alpha = 1;
}
ctx1.fillStyle = 'rgba(255,255,255,' + this.alpha +')';
ctx1.fillText("GameOver",canWidth/2,canHeight/2);
}
ctx1.restore;
2015-12-02
你的restore方法沒有加括號
2015-11-25
是不是樣式 權重的問題影響了