立即学习:https://edu.csdn.net/course/play/27397/365780?utm_source=blogtoedu
canvas的用法
- 定义对象 var a={ a-1:[],a-2:[], ······a-n:[] }
- 初始化 a.a-1 = { }; ······
- 获取到canvas
- 获取画布 .getContext('2d')
- 开始新路径 .beginPath();
- 形状 弧形 .arc(x,y,radius,startAngle, endAngle, antiClockwise) x,y表示弧中心点 radius半径 startAngle开始角度 endAngle结束角度 antiClockwise顺时针还是逆时针。
- 描边和填充 .stroke() ; .fll();
- 保存当前状态 .save();
- 返回调整 .restore();
填充背景: .fillStyle
画文字:fillText('内容',x,y)