Open IgorMats opened 9 years ago
Sorry for the confusion, in fact, we don't have the latest version of Spine in web engine, that's where all these confusion came from. Please be patience, we'd like to upgrade it, but as Spine doesn't have a official js implementation, that will take some effort. To be honest, we don't have man power for it currently
Okay, I get it.
So maybe I should implement setStartListener
and setCompleteListener
method in cocos2d-html5 branch for temporarily compatibility?
You can try it, I mean I'm not familiar with Spine, but it seems they changed a lot in the new version, so I'm not confident with a simple implementation
Here I'm not talking about implementation of all spine API but we can temporarily implement setStartListener
and setCompleteListener
on javascript level with something like this:
this.setAnimationListener(this, this.onAnimationStateChanged.bind(this));
/**
*
*
*
*/
onAnimationStateChanged: function(target, type, index, event) {
switch(type) {
case 0:
this.onAnimationStart(index);
break;
case 1:
this.onAnimationFinish(index);
break;
}
}
What do you think about this?
Thanks.
Yes, of course, our JS level wrapper do exactly this kind of things. Please create a jsb_spine.js
file in frameworks/js-bindings/scripts
folder and put the wrapper there, you will also need to modify frameworks/js-bindings/scripts/jsb.js
to load it when JS engine start up.
Hi.
It seems I found some inconsistent methods:
setAnimationListener
method ofsp.SkeletonAnimation
class but on native platforms (e. g. cocos2d-x) it doesn't work.setStartListener
andsetCompleteListener
methods but cocos2d-html5 haven't!I was very confused when found this issue.
So should I fix it? Thanks.