用这个方法,load在子域中没法用,必须使用wx的方法
setUserAvatar = (sprite: cc.Sprite, avatarUrl: string) => {
if (avatarUrl) {
const image = wx.createImage()
image.onload = function () {
const texture = new cc.Texture2D()
texture.initWithElement(image)
texture.handleLoadedTexture()
sprite.spriteFrame = new cc.SpriteFrame(texture)
}
image.src = avatarUrl
}
}
1赞
要做一个代理请求处理 用nginx做一个代理
谢谢老铁, 解决了我的问题.
做什么代理啊, 2楼的方法是对的. 别误导别人啊
