Skip to content

Conversation

@bigflower
Copy link

更改了 play 方法里 不能播放一次的BUG,当 loop 为 false 时候 动画只能播放一帧,并不能完全播放完后停止,所以把 loop 判断里 loop 为假的时候 this._loopType = ccs.ANIMATION_TYPE_NO_LOOP; 改为 this._loopType = ccs.ANIMATION_TYPE_TO_LOOP_FRONT;

更改了 play 方法里 不能播放一次的BUG,当 loop 为 false 时候 动画只能播放一帧,并不能完全播放完后停止,所以把 loop 判断里 loop 为假的时候 this._loopType = ccs.ANIMATION_TYPE_NO_LOOP; 改为 this._loopType = ccs.ANIMATION_TYPE_TO_LOOP_FRONT;
@dingpinglv
Copy link
Contributor

Hi bigflower,

I don't think your modify codes are right.
I have tested the cowboy animation, codes:
this._armature = ccs.Armature.create("Cowboy");
this._armature.getAnimation().play("Fire", 10, 0);

It runs once. I think its behavior is right.

And if it applies your modify codes, the animation always runs in a loop.

The loop parameter means:
* Whether the animation is loop.
* loop < 0 : use the value from CCMovementData get from flash design panel
* loop = 0 : this animation is not loop
* loop > 0 : this animation is loop

Best regards
David

@bigflower
Copy link
Author

有的需求是完整运行一次动画后停止,this._armature.getAnimation().play("attack", 10, 0);这种形式的 貌似只是运行了一帧就停止了,所以才做了修改,修改后达到预期效果,你可以试试 js-tests 里 CocoStudioTest -> ArmatureTest -> ArmatureTest.js -> TestAnimationEvent 这个例子,改为 armature.getAnimation().play("attack", 10, 0); 这样后无法播放完毕,只播放一帧就停止掉了

@wangjiebha
Copy link

提交一个书写问题!

目前COCOS2D-X.ORG上

Download v3.0alpha2

有一个书写问题。

uiWidget.js

getChildByTag: function (tag) {
var __children = this._widgetChildren;
if (__children != null) {
for (var i = 0; i < __children.length; i++) {
var node = __children[i];
if (node && node._tag == tag) //这里的_tag应该是tag..导致getChildByTag获取是NULL
return node;
}
}
return null;
}

@dingpinglv
Copy link
Contributor

Hi @wangjiebha

The bug of uiWidget has been fixed at: #1852

Thanks for you feedback.
David

@dingpinglv
Copy link
Contributor

Hi @bigflower

I have tested TestAnimationEvent with armature.getAnimation().play("attack", 10, 0); , it will log a message "this._movementData can not be null", the armature file doesn't have "attack" animation.

I tried to use armature.getAnimation().play("Fire", 10, 0); ,it works well.
image

Sorry to reply late.
David

@wangjiebha
Copy link

这个armature.getAnimation().play("attack", 10, 0);

确实存在一定的问题。如果你在COCOSTUDIO编辑的动画。导入到程序,在没有开启LOOP的情况下.确实会只播放1-2帧就停止了动画。动画没有播放完整
如果加入了。armature.getAnimation().animationInternal=7/60;调节了帧的频率。就可以播放完整了。
但是希望是armature.getAnimation().play("attack", 10, 0);这样不开启循环就可以播放完整一遍动画!
PS :这个问题主要是在WEB浏览器的方式出现。打包后没测试。
你可以在COCOSTUDIO编辑一个动画。在程序里调用一下。然后通过WEB浏览的方式测试

@dingpinglv
Copy link
Contributor

Yes, We'll fix it soon.

I'm sorry to reply late, because this issue is very complex to fix.

Thanks for your comment.
David

VisualSJ added a commit to VisualSJ/cocos2d-html5 that referenced this pull request Jun 5, 2014
dingpinglv added a commit that referenced this pull request Jun 5, 2014
Issue #1851: Fixed a bug about Armature loop
@dingpinglv
Copy link
Contributor

Hi @bigflower

This bug has been fixed at VisualSJ@3a5de72
Please try it again after pull the latest branch of "develop".

Best regards.
David

@dingpinglv dingpinglv closed this Jun 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants