分享网正式开通,我们为大家提供免费资源,欢迎大家踊跃投稿!

html5使用canvas绘制文字特效

<canvas id="canvas" width="500" height="400" style="background-color: yellow;"></canvas>
 

复制代码代码如下:
var canvas=document.getElementById("canvas");
var cxt=canvas.getContext("2d");
cxt.font="40px 黑体";
//绘制实心字
cxt.fillStyle="red";//填充红色
cxt.fillText("hello,思思博士",10,50);
//绘制空心字
cxt.strokeStyle="red";//红色边
cxt.strokeText("hello,思思博士",10,100);


套路很深,不支持下载!


爱资源分享网 , 版权所有丨本站资源仅限于学习研究,严禁从事商业或者非法活动!丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:html5使用canvas绘制文字特效
喜欢 ()分享 (0)