Adamfarl

  • 4 janv. 2014
  • Inscrit 3 mai 2013
  • I'm probably just to dumb to figure it out but it should be simple to do.

    It is really easy to switch the images in the editor using attachments. Do you just want to switch the images in code? Or do you want to dynamically load new images and attach them to a slot/bone combo like I am trying to do?

  • I know this has been asked a few times, but its still not clear to me. I have referenced this page as well and it hasn't been sufficient.
    http://esotericsoftware.com/spine-using ... mentloader

    I have an attachment created for the rHand where I want to exchange the hand with a hand weapon.

    "rHand":{"rHand":{"name":"wizard/rHand","x":7.26,"y":1.45,"rotation":130.31,"width":26,"height":25}},

    Do I have to create an attachmentLoader to pull in the new image called battleAxe.png?

    As I have read before, I don't need to tie this attachment to a skin right?

                     [[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"weapons.plist"];
                      
    spAttachmentLoader* attachmentLoader; spAttachment* attach = AttachmentLoader_newAttachment(attachmentLoader,NULL ,ATTACHMENT_REGION,"battleAxe.png"); //Get the slot index of the weapon in the skin spSlot_setAttachment([anim findSlot:@"rHand"], attach);

    Thanks!

  • I cant seem to find any documentation on how the events in the editor work?

    I can define an event and key it in the editor, see if generated in my JSON file, but how do I actually use this event in code?

  • I have seen the code for setting the transitions using mix:

    	
    [animationNode setMixFrom:@"walk" to:@"jump" duration:0.2f];
    [animationNode setMixFrom:@"jump" to:@"walk" duration:0.4f];
    

    But it seems to finish the animation of walking before moving to the jump animation.... therefore when I hit a "jump" button it has a delay. Even if I set the duration to a really low value, same effect.

    What is the best practice for making this transition quicker? Stop the walk animation then set the jump animation?

    Thanks!

  • It would be awesome if there was an example of just setting up the skeletonNode as a box2d body and then setting up the individual slots as attachments so you could do ragdoll.

    Maybe its actually simpler than I thought now that I am thinking about it more. At least the first part is....

  • So Nate provided a nice link to a Java implementation of Box2d with Spine, but im having a bit of trouble understanding it since I dont know Java at all... I can probably figure it out but I was wondering if anyone had a generic example in ObjC using Box2d?

    Thanks!
    -Adam

  • Yah I am using the latest....

    What we finally did was to add

    using namespace spine;

    to the file that I am importing spine-cocos2d-iphone.h in. That solved the problem for me! Now it works fine.

  • Yah I am importing spine-cocos2d-iphone.h.

    It is asking if I want to use "spine::Atlas" but that looks like C++ to me.

    Ill take a look at the example you provided to see if there is anything there.

  • I'm going to see if anyone has any ideas about my problem before I go posting a bunch of detailed info.

    I downloaded the cocos2d runtime and got the sample project to compile and run great!

    Now I am trying to pull those into a new project that I have already been working on and it gives me an error stating that "Atlas" is an unknown type. I have atlas.c pulled into my project and it is even show in the compile list but for some reason the compiler is not finding that definition.

    Any thoughts??

    Thanks for all the support! You guys have a great tool and are doing a great job!