@310301967 写道:
cc.Class({
extends: cc.Component,
properties: {
my_sprite:cc.Sprite
},
// use this for initialization
onLoad: function () {
var url = 'http://wx.qlogo.cn/mmopen/HmVQlX9WkBttyPZYDHamRX1VchOM2FxyfkPcPRNFzoy42k6Y3B74Mdb52aSWDdbibGvTx7W916mbmGWibRickJb3w/0';
var self = this;
cc.loader.load(url, function (err, tex) {
cc.log('Should load a texture from external url: ' + (tex instanceof cc.Texture2D));
var spf=new cc.SpriteFrame();
spf.initWithTexture(tex);
self.my_sprite.spriteFrame=spf;
});},
});
URL换成.png的图片,模拟器可以,浏览器不行,现在用微信的图像地址两个都不能显示。求完整的解决代码
帖子: 2
参与者: 1