首先效果图。
飘落个数,速度,同时最多出现几个一起飘可以控制

代码
<canvas canvas-id="myCanvas" class="my-canvans" v-if='canvansShow'/>
// canvansShow 默认true
onShow () {
this.createStar(this.imgUrl)
},
mothods{
createStar (imgUrl) {
// #ifdef MP-WEIXIN
let starImage = ''
uni.getImageInfo({
src: imgUrl,
success: res => {
starImage = res.path
}
})
// #endif
let {
requestAnimationFrame } = this
function Star (x, y, radius) {
this.x = x
this.y = y
this.sx = 0
this.sy = 0
this.deg = 0
this.

最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



