综合查询资料个人理解canvas
支付宝小程序开发文档canvas.js
.
onReady() {
// 页面加载完成
//页面加载完成后,获取随机point,只获取一次,供draw()绘图使用
this.point = {
//生成[0,590)之间的随机数
x: Math.random() * 590,
y: Math.random() * 590,
dx: Math.random() * 10,
dy: Math.random() * 10,
//[0,255]之间整数
r: Math.round(Math.random() * 255 | 0),
g: Math.round(Math.random() * 255 | 0),
b: Math