johnedvard

  • 4 juin 2023
  • Inscrit 10 juin 2013
  • I know this is an old discussion, but I landed on this page facing a similar issue.
    I'm using Phaser 3.55.2, and I exported skeleton data using Spine 3.8.
    Now, this thread helped me a lot, but I was using a camera that followed the protagonist in my game, so I had to compensate for the scrollX and scrollY offset, as well as the height of the canvas. This may have been because of my setup, but I hope it can be useful for someone else facing a similar issue in the future.

    Here's the code I ended up using to be able to move a bone in the Spine skeleton

    const pos = new Phaser.Math.Vector2(
      cordX - this.scene.cameras.main.scrollX,
      this.scene.cameras.main.scrollY - cordX + this.scene.cameras.main.height
    );
    
    skeleton.findBone('root').worldToLocal(pos);
    const bone = skeleton.findBone('theBoneToMove');
    bone.x = pos.x;
    bone.y = pos.y;
  • I just wanted to let you know that I found this post after facing the same issue. It worked after selecting version 3.8 (instead of 4.0) when I exported the Spine project.

  • Welcome Siniša! I am happy to hear that Esoteric Software is growing, and I am looking forward to the animation tutorials!
    I also enjoyed Prince of Persia, The Sands of Time when I was younger 🙂

  • Thanks again for the prompt reply.

    Understood, and thanks for the suggestions 😉

  • Thanks for the prompt reply.
    I should have been more clear in my question I think. I am not using the Spine Plugin.

    I want to load an atlas using Phaser's LoaderPlugin, like this:

    this.load.atlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.json');
    

    Here is a practical example from their web site: https://phaser.io/examples/v3/view/animation/texture-atlas-animation

    I really like the texture packer from Spine, so I was hoping I could export the atlas in .json format, if possible.

  • Hello.
    Is it possible to export the texture atlas file as a .json file instead of an .atlas file? I want to use the atlas in a Phaser project, but they only accept .json atlases.

    I tried changing the "Atlas extension" to .json instead, but it did not work. I am using Spine version 3.8.96

  • Thanks a lot. Problem solved!
    I followed your last advice by just copying the source code into my project (don't know why I did not think of that). Now I can finally try to get those animations up and running ^^

    Thanks again.

  • thanks for the reply, but I am still having issues.

    When I try to open spine-xna.sln into Visual Studio 2012, I get this error message:

    " Windows is not a supported platform in this version of XNA Game Studio, or this edition of Visual Studio. The project may not build or launch as expected "

    I notice that all the references in the project is marked with a warning message, telling me that: the referenced component 'name.of.the.component' could not be found.

    I also tried to reference the spine-xna project into my game-project (even though I got the error stated above) and I get this error message:
    " Unable to add the specified project reference. The reference must be a Windows Phone project that targets the current or earlier versions of the Windows Phone OS"

    I will try to figure out why I get all these errors and warnings, but if you have any suggestions I would be more than happy to know them. I can also mentioned that I started four days ago on a game for windows phone 8 using monogame in visual studio 2012 and everything have worked well until now. I really want to use the animations I created in Spine in my game and hope someone have a solution to my problem (if I am unable to find one myself) 🙂

  • This might sound like a silly question, but how do I import the monogame(xna)-runtimes into Visual Studio 2012 ( for Windows Phone 8 development )?
    I have pulled the latest runtimes from git, but I am not sure what to do next. I am not familiar with Visual Studio nor external libraries/runtimes.

    I want to achieve this at the top of my class:

    using Spine;

    and not receive any errors in my code: (e.g The type or namespace name 'Spine' could not be found (are you missing a using directive or an assembly reference?)

    I imagine the solution to my problem is simple, but I have no clue what to do.

    Hope you understand my question and can give me a helping hand.