待回答
var sprite = new cc.Sprite(img);
var anim=new cc.Animation(frames,0.08);//默认是12帧每秒
sprite.runAction(cc.animate(anim)); //请问这里如何知道该动画播放完毕?
因为我的帧动画时播放一次 然后再停止一段时间 然后继续播放。
而不是一直循环,没有间隔。
待回答
var sprite = new cc.Sprite(img);
var anim=new cc.Animation(frames,0.08);//默认是12帧每秒
sprite.runAction(cc.animate(anim)); //请问这里如何知道该动画播放完毕?
因为我的帧动画时播放一次 然后再停止一段时间 然后继续播放。
而不是一直循环,没有间隔。
skill.getAnimation().setMovementEventCallFunc(function(armature, movementType, movementID){
if (movementType == ccs.MovementEventType.complete) {
//todo
}
},skill);
谢谢。 不过我用的不是CCS的功能。 是自己拿单张图片精灵 程序自己拼接的。
原来是在sequence里加入CALLBACK实现。
var seq = cc.sequence(cc.animate(anim), cc.callFunc(_self._onAnimationend,_self,{target:sprite}));
seq.setTag(1);
然后我的问题是:
function _onAnimationend(target){
var act=target.getActionByTag(1);
target.runAction(act); //这里就会崩溃掉。。。 是因为动作已经做完,不可以再次播放吗?
}
提示什么呢?