cocos creator 微信头像的远程加载


cocos creator 微信头像的远程加载

1
2
3
cc.loader.load({url: headimgurl+'?file=a.png', type: 'png'}, function (err, tex) {      
node.getComponent(cc.Sprite).spriteFrame=new cc.SpriteFrame(tex)
});
1
2
3
4
5
6
cc.loader.load({url: headimgurl+'?file=a.png', type: 'png'}, function (err, tex) {
let node=new cc.Node('tx')
let sprite=node.addComponent(cc.Sprite)
sprite.spriteFrame=new cc.SpriteFrame(tex)
this.node.addChild(node)
});