好糾結這個問題。fillText顯示不出來
window.onload=function(){
???var?canvas=document.getElementById("canvas");
???canvas.width=800;
???canvas.height=800;
???var?context=canvas.getContext("2d");
???context.font="bold?40px?Arial";
???context.fillStyle="#058";
???context.fillText=("快樂學習,快樂進步!",40,100);
???context.lineWidth=1;
???context.strokeStyle="#058";
???//context.strokeText("快樂學習,快樂進步",40,100);
????
???context.fillText=("快樂學習,快樂進步",40,300,400);
???//context.strokeText("快樂學習,快樂進步",40,400,400);
???}這樣寫就看不到文本了
2015-09-01
你這代碼寫的沒問題可以看到啊,你自己看看標點符號中英文。也可以F12看看錯誤提示。
2017-01-16
context.fillText=("快樂學習,快樂進步!",40,100);?
改為context.fillText("快樂學習,快樂進步!",40,100);
去掉等號“=”