popple

createWithFile("spineboy.json", "spineboy.atlas")

i tryed to create two SkeltonAnimation object with same file like"spineboy".

but it's not work. some bugs..in update

void CCSkeletonAnimation::update (float deltaTime) {
super::update(deltaTime);

deltaTime *= timeScale;
for (std::vector<AnimationState*>::iterator iter = states.begin(); iter != states.end(); ++iter) {
AnimationState_update(*iter, deltaTime); //this line
AnimationState_apply(*iter, skeleton);
}
Skeleton_updateWorldTransform(skeleton);
}

but, if addChild in one CCNode then no bug..

how can i get a same one?
popple
  • Сообщения: 13

Nate

If I add this to the end of the spineboy example it works fine:
CCSkeletonAnimation* skeletonNode2 = CCSkeletonAnimation::createWithFile("spineboy.json", "spineboy.atlas");
skeletonNode2->setAnimation("walk", true);
addChild(skeletonNode2);
Аватара пользователя
Nate

Nate
  • Сообщения: 9241

popple

try remove this line skeletonNode2->setAnimation("walk", true);
popple
  • Сообщения: 13

Nate

That also works fine. The second spineboy doesn't walk, just stands in the setup pose.
Аватара пользователя
Nate

Nate
  • Сообщения: 9241

popple

oh no. sorry...

it's caused by a pointer error :D it's works fine。
popple
  • Сообщения: 13


Вернуться в Bugs