使用 cc.loader.load方法时,发现在web浏览器中可以加载到图片。但是在原生环境中就无法成功加载,请问是什么问题呢?
上传中…
cc.loader.load(cc.url.raw(’/Image/peroninfo/photo.png’), function (err, tex) {
cc.log('Result should be a texture: ’ + (tex instanceof cc.Texture2D));
this.photoimage.spriteFrame = new cc.SpriteFrame(tex);
})
这的参数应该是路径URL(字符串)啊
只允许动态加载 resources 目录下的资源。