从服务器下载的atlas png json 文件,需要调哪个方法加载呢?
试过cc.loader.load方法,但是好像会报错。
E/JS Exception: 拦截到 JS 错误:
文件名:assets/src/jsb_polyfill.js line 21908 > Function,
行数:2,
错误提示:this.initProps is not a function,
错误堆栈:CCClass@assets/src/jsb_polyfill.js line 21908 > Function
1
[106]</proto.itemComplete@assets/src/jsb_polyfill.js:18468:21
[106]</LoadingItems.itemComplete@assets/src/jsb_polyfill.js:18323:26
[109]</proto.flowOut@assets/src/jsb_polyfill.js:18757:17
flow@assets/src/jsb_polyfill.js:18674:25
flow@assets/src/jsb_polyfill.js:18678:32
[109]</proto.flowIn@assets/src/jsb_polyfill.js:18739:25
[106]</proto.append@assets/src/jsb_polyfill.js:18401:80
[98]</proto.load@assets/src/jsb_polyfill.js:17358:17
抱歉目前应该还不支持。三个文件分别 load 以后,你手动 var asset = new sp.SkeletonData 试试,然后给 asset 里的 property 赋值,具体请参考源码 engine/extensions/spine/SkeletonData.js
@jare 我试了下手动构造SkeletonData,但是还是不行。是不是我哪里的写法不太对?
图里的TextureParser和回调中的设置property的逻辑是参考spine-meta写的
最终结果不报错,但是也没有任何东西显示出来
请问这个问题 最终解决了吗
这个 能够实现不
解决了 不知道 这样合适不 var that=this;
var fs_url=jsb.fileUtils.getWritablePath();
var downloadPath=fs_url+‘spineRaptor/raptor’;
cc.log(‘downloadPath:–’+downloadPath);
cc.loader.load([downloadPath+".json",downloadPath+".png",downloadPath+".atlas"],function(errors,results){
if(errors){
cc.log(‘errors:’+JSON.stringify(errors));
};
var fileJson=downloadPath+".json";
var fileAtlas=downloadPath+".atlas";
var a=sp._SGSkeletonAnimation.createWithJsonFile(fileJson,fileAtlas);
a.setAnimation(0, ‘walk’, true);
that.node._sgNode.addChild(a);
})
這個可以用嗎?
[var a=sp._SGSkeletonAnimation.createWithJsonFile(fileJson,fileAtlas);]???


