如题吧
同样的代码 在电脑浏览器里面就可以加载进去 但是手机浏览器里面就不行
求大佬指教 跪谢
大概是这么一个写法
properties: {
label: {
default: null,
type: cc.Label
},
sp:{
default:null,
type:cc.Sprite
},
// defaults, set visually when attaching this script to the Canvas
text: 'Hello, World!'
},
// use this for initialization
onLoad: function () {
this.label.string = this.text;
var _this = this;
var url = ‘https://a-ssl.duitang.com/uploads/item/201407/05/20140705144822_akWZc.jpeg’;
cc.loader.load(url, function(err, tex){
cc.log(“have fun !”);
var sf = new cc.SpriteFrame(tex);
_this.sp.spriteFrame = sf;
});
},
点creator上面的调试按钮 在浏览器里面可以加载出来这个xxx,jpeg
但是 我用手微信扫码打开连接 或者直接在手机默认浏览器里面输入ip和端口
这个sp就还是之前默认的纹理 没办法加载到网络图片