ducky

cocos2d 的 JavaScript 有沒有辦法實現兩段動畫混和疊加?
比如混和疊加一段走路及一段攻擊的骨架後,實現邊走路邊攻擊且循環的動態效果,
目前看到的都是其他語言的寫法,自己實作 JavaScript 的寫法都無法表現出兩者混合撥放的效果。
ducky
  • Beiträge: 3

badlogic

您能通过图像说明两段融合的意思吗? 至于对cocos2d JavaScript Spine的支持,恐怕我们没有写过,所以很难知道会发生什么。 您可以链接到您想要做什么的另一种编程语言中的示例吗? 我们可以尝试将其翻译为JavaScript。
Could you illustrate what you mean with 2 segment blending via an image? As for the cocos2d JavaScript Spine support, I'm afraid we did not write that, so it is hard to know what might be going on. Could you link to an example in another programming language that does what you want? We could try to translate it to JavaScript.
Benutzeravatar
badlogic

Mario
  • Beiträge: 2099

ducky

像是這樣,兩個骨架同時循環撥放,並可以同時存在互相影響,

1572421232092.jpg

1572421245208.jpg


以下是我在網路上搜尋到的資料,其中的第二點动画叠加(trackIndex)的部分,再麻煩幫我解答了!!感謝~
https://www.cnblogs.com/BigFeng/p/6781855.html
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
ducky
  • Beiträge: 3

badlogic

我相信我明白。 您想在同一骨骼上同时播放两个动画,并同时混合两个动画。

我研究了用于Spine的Cocos Creator JS API,它具有您要使用的setAnimation()和addAnimation()方法。

https://docs.cocos.com/creator/api/zh/classes/Skeleton.html

Cocos Creator还附带了一个Spine示例,看看:

https://github.com/cocos-creator/example-cases/blob/master/assets/cases/spine/SpineCtrl.js

它向您展示如何对动画进行排队,如何设置混合持续时间(从一种动画混合到另一种动画(例如从步行到跑步)所用的时间)。

这有帮助吗?

I believe I understand. You want to play two animations at the same time, on the same skeleton, and have both animations mix.

I looked into the Cocos Creator JS API for Spine, and it has the setAnimation() and addAnimation() methods you want to use.

https://docs.cocos.com/creator/api/zh/classes/Skeleton.html

Cocos Creator also comes with a Spine example, have a look:

https://github.com/cocos-creator/example-cases/blob/master/assets/cases/spine/SpineCtrl.js

It shows you how to queue animations, how to set mix durations (time used when blending from one animation to another, e.g. from walk to run).

Does this help?
Benutzeravatar
badlogic

Mario
  • Beiträge: 2099

ducky

謝謝!! 這對我很有幫助!!
另外想再請問一下,該如何設定成增加權重去控制3個動態的混和比例呢?
ducky
  • Beiträge: 3

badlogic

您的意思是在Spine编辑器中? 我建议为此问题打开一个单独的线程,并用图像说明您要实现的目标。
You mean in the Spine Editor? I suggest to open a separate thread for this issue and illustrate with images what you want to achieve.
Benutzeravatar
badlogic

Mario
  • Beiträge: 2099


Zurück zu 中国Spine用户