Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Spine: 2D skeletal animation for games  (Read 27567 times)

0 Members and 1 Guest are viewing this topic.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Spine: 2D skeletal animation for games
« Reply #15 on: February 20, 2013, 08:55:15 pm »
A texture atlas is just a big texture that contains multiple images. It doesn't require a class to handle it, it's just a matter of using texture coordinates other than 0 and 1 ;)
Laurent Gomila - SFML developer

NateS

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Email
Re: Spine: 2D skeletal animation for games
« Reply #16 on: February 20, 2013, 09:05:44 pm »
Ok, thanks. Wanted to be sure before I wander off into the weeds. :)

@Laurent, yes, it's the loading of the atlas data I wanted to avoid writing myself, if something already exists.
« Last Edit: February 20, 2013, 09:18:45 pm by NateS »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Spine: 2D skeletal animation for games
« Reply #17 on: February 20, 2013, 10:33:58 pm »
Do you mean that you're using a specific file format that describes the contents of the texture atlas? What format is it?
Laurent Gomila - SFML developer

NateS

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Email
Re: Spine: 2D skeletal animation for games
« Reply #18 on: February 20, 2013, 10:38:46 pm »
There are a number of atlas formats, seen on the screenshot here (if you squint hard enough):
http://www.codeandweb.com/texturepacker
I like to use my own (free, OSS, no GUI (that is a feature!), configuration by convention) tool for texture packing:
http://code.google.com/p/libgdx/wiki/TexturePacker
Its format is line-based, though I think I will change it to JSON soon (now might be a good time before I write a C++ parser...). If SFML supported any standard format, that'd be nice since using an atlas is such a common task.
Edit: libgdx texture atlas format example:
https://github.com/libgdx/libgdx/blob/master/tests/gdx-tests-android/assets/data/uiskin.atlas
Edit2: libgdx texture atlas format parsing code:
https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/TextureAtlas.java#L97
« Last Edit: February 20, 2013, 10:43:35 pm by NateS »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Spine: 2D skeletal animation for games
« Reply #19 on: February 20, 2013, 11:05:36 pm »
I see.

SFML doesn't and won't support this kind of format, it's just a multimedia API, not a game framework ;)
Laurent Gomila - SFML developer

NateS

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Email
Re: Spine: 2D skeletal animation for games
« Reply #20 on: February 23, 2013, 03:00:22 am »
Got a Spine runtime for SFML working:
http://www.kickstarter.com/projects/esotericsoftware/spine/posts/411140
It still needs some work, to be broken out into its own project, etc but it works!

Only 18 hours left on the Kickstarter. :)

Halsys

  • Jr. Member
  • **
  • Posts: 66
  • Halsys like Hal.sys
    • View Profile
    • Email
Re: Spine: 2D skeletal animation for games
« Reply #21 on: March 01, 2013, 08:32:11 pm »
Bought Spine, and it already feels like a good investment... Looking forward to see how well this program/library matures!
If you notice I put "....", in my sentences way too much... I'm sorry.

NateS

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Email
Re: Spine: 2D skeletal animation for games
« Reply #22 on: March 30, 2013, 06:13:51 pm »
Just an update since it's been a while, the SFML runtime for Spine has been done for quite some time. I'm getting rid of the C++ Spine runtime in favor of using the new C runtime, so SFML support has been updated to be based on that:
https://github.com/EsotericSoftware/spine-runtimes/tree/master/spine-sfml

rorlick

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Spine: 2D skeletal animation for games
« Reply #23 on: June 09, 2013, 02:09:43 am »
Hey I'm just starting to include spine in my project, and I'm having what seems to be a pretty basic issue.  This is my first time using git so it could be chalked up to that.  I cloned the repositories from git, but the spine-sfml.cpp calls this include:

#include <spine/extension.h>

which isn't under the sfml runtime folder.  Should I use the includes under spine-c instead?  I tried doing this and it gave me a bunch of errors, although that could have been something with Xcode.

Edit: Ok, so I did get it to run at the least(by adding the .c and .h files from spine-c). Now however, I get this error:

Thread 1: EXC_BAD_ACCESS(code=1, address 0x38)

On this line:

Animation* SkeletonData_findAnimation (const SkeletonData* self, const char* animationName) {
   int i;
   for (i = 0; i < self->animationCount; ++i)
      if (strcmp(self->animations->name, animationName) == 0) return self->animations;

   return 0;
}

I believe this is something to do with the pointer getting released before it is called, is that correct?
« Last Edit: June 09, 2013, 03:16:42 am by rorlick »

NateS

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Email

 

anything