export class Main {
constructor() {
this.canvas = wx.createCanvas();
this.ctx = this.canvas.getContext("2d");
var image = wx.createImage();
image.src = "res/bg.png";
image.onload = () => {
this.ctx.drawImage(
image,
0,
0,
image.width,
image.height,
0,
0,
this.canvas.width,
this.canvas.height,
);
};
}
}
你好,小游戏相关问题麻烦移步小游戏专区提问,此帖隐藏,请重新发帖提问,感谢配合
小游戏专区:https://developers.weixin.qq.com/community/minigame