semtiko

  • 29 янв 2021
  • Регистрация: 17 фев 2014
    Shiu написал

    Thanks for sharing. looks great 😃

    Thank you very much! 🙂

    P.S. Craft King now available for iOS!

    • Изменено

    Hi. I just released spine + libgdx powered game.

    Android Free: https://play.google.com/store/apps/deta ... ftkingfree
    Android Full: https://play.google.com/store/apps/deta ... .craftking
    iOS https://itunes.apple.com/app/craft-king/id896262921

     Loading Image  Loading Image
     Loading Image  Loading Image
     Loading Image  Loading Image

    I really happy to work with Spine! I will add much more animation and enemies. Can't imagine this work without Spine!
    Thanks you very much, Spine developers! =)

    • Изменено

    Thanks for reply!
    I don't know why, but i can't reproduce this problem anymore. I tried all, what i can, but problem is gone.
    Solved )))

    Hi. Problem is here again.
    1.8.41 Pro, latest libgdx runtime. Json works good, but binary is broken.

    If i just add mesh without keys and use SpriteBatch for render, it crash with:

    Exception in thread "LWJGL Application" java.lang.RuntimeException: PolygonSpriteBatch is required to render meshes.
       at com.esotericsoftware.spine.SkeletonRenderer.draw(SkeletonRenderer.java:144)
    

    Using PolygonSpriteBatch fixed it, but if i add FFD animation, i have this:

    Exception in thread "LWJGL Application" java.lang.IndexOutOfBoundsException: index can't be >= size: 1 >= 1
       at com.badlogic.gdx.utils.Array.get(Array.java:127)
       at com.esotericsoftware.spine.SkeletonBinary.readAnimation(SkeletonBinary.java:395)
       at com.esotericsoftware.spine.SkeletonBinary.readSkeletonData(SkeletonBinary.java:162)
    

    It's only one what worked for me - http://esotericsoftware.com/forum/viewt ... 646#p13646
    I tried namy ways to get attachment, but i'm always have null.
    Anyway - i've got what i need.
    Thank you, guys!


    Oh, i found why setAttachment doesn't work for me - i just forgot to remove old test line from my code 😃

    skeletonData.setDefaultSkin(skeleton.getSkin());
    

    Thank you very much and sorry for my inattention!

    I tried to use simple way as you said, but it looks little bit strange for me. Let me explain.
    I have one skin for player. All bones have "skinnable" images except one part. This part just have attached images which i control through code. When i initialize skeleton i call:

    skeleton.setSkin("player");
    

    In this case calling "skeleton.setAttachment..." gives me:

    Exception in thread "LWJGL Application" java.lang.IllegalArgumentException: Attachment not found: targetImage, for slot: targetSlot
       at com.esotericsoftware.spine.Skeleton.setAttachment(Skeleton.java:257)
    

    If i remove line "skeleton.setSkin("player");" main images doesn't visible (of course), but presumably skin now is "default", but i still have same problem (Attachment not found). If i call "skeleton.setSkin("default");", main images still invisible (of course), but now calling "skeleton.setAttachment" is works.

    • Изменено

    Thank you!
    You need to say samewhere in manual about "default" skin. I spent many hours to understand how i can work with attachment without skin 😃

    skeleton.findSlot("targetSlot").setAttachment(
       skeletonData.findSkin("default").getAttachment(
          skeleton.findSlotIndex("targetSlot"), "targetAttachment"
       )
    );
    
    • Изменено

    Hi.
    Can i change sprites/images through code (libgdx backend)? If yes - how, if i know only bone name?
    Thanks!