flamingo

  • 15. srp. 2013
  • Pridružuje se 7. tra. 2013
  • Thanks! It works.

  • Thanks, clearAnimation works, but I want a little different behavior:

    "set initial frame to a skeleton immediately"?

    For example, Player skeleton plays "walk" animation if I press a button, but when button is released, I want not only to stop animation, but also set the skeleton sprite in initial position, like zero frame. Is it possible?

  • Hi!

    I use C api in my cocos2d-x application and this is the question: how to stop current animation and set initial frame to a skeleton immediately? Maybe it's a popular question, but I didn't find something related.

    BTW, do you plan to provide complete C++ API?

  • Thanks! It works.

    One more question. How fast is this framework? On my Acer A500 it gives me about 20-25 FPS when I start playing animation... (without any physics handling, as I did above)

  • Hi!

    I'm currently working on spine integration and want to use Box2D physics for skeletons.
    I read this https://github.com/EsotericSoftware/spine-workshop/blob/master/src/com/esotericsoftware/spine/workshop/I_Box2D.java code and try to implement such behavior in my C++ project.

    For now I have the following result:

    You can see, box2d bodies are positioning relatively to the Bones point, but I want to place the bodies where the Attachments placed.

    My code in function "draw":

            // for every slot in skeleton
            spine::Slot *currentSlot = m_skeleton->skeleton->slots[i];
            if (currentSlot->attachment->type != spine::ATTACHMENT_REGION)
                continue;
    
        float x = currentSlot->bone->worldX / PTM_RATIO;
        float y = currentSlot->bone->worldY / PTM_RATIO;
    
        // Just 0 for now (test code)
        float rot = 0;//DegToRad(currentSlot->bone->worldRotation);
    
        // m_skeletonParts is box2d bodies, one for each "spine" slot.
        m_skeletonParts[i]->SetTransform(b2Vec2(x, y), rot);
    

    How can I get the positions of the attachments?
    Thank you!