cocos creator小游戏加载跨域头像
// 玩家头像 和 名字 (防止跨域问题)cc.assetManager.downloader.downloadDomImage(avatarUrl ,null, (err, img) => {if(err){cc.error('玩家头像错误='+err)return}let texture = new cc.Texture2D();texture.initWithElement(img);texture.handleLoadedTexture();this.headNodeArr[0].getComponent(Sprite).spriteFrame = new cc.SpriteFrame(texture);})
如果觉得《cocos creator小游戏加载跨域头像》对你有帮助,请点赞、收藏,并留下你的观点哦!