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

Author Topic: SFML Spine  (Read 3002 times)

0 Members and 1 Guest are viewing this topic.

Cyraxx

  • Newbie
  • *
  • Posts: 8
    • View Profile
SFML Spine
« on: April 23, 2014, 12:01:25 pm »
Hello!
I'm fairly new to Spine, well and SFML itself and I was wondering if any of the more experienced programmers here could help me out.
So my problem is that I have no clue how to move characters/animations made with Spine. Nor am I able to figure out how could I get a hitbox for it. (we are making a sidescroller platformer game)
We already made a decent collision detection and some basic physics using sprites but we just can't do it with Spine. Please help us! :)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: SFML Spine
« Reply #1 on: April 23, 2014, 12:16:35 pm »
There've only been very few people using Spine with SFML, not sure if anyone is hanging around here.

If you want concrete help, you need to ask specific questions.
The only thing I can provide at the moment is the official example.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Cyraxx

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: SFML Spine
« Reply #2 on: April 23, 2014, 12:50:58 pm »
Thanks for the quick reply. I'd already checked the example you linked (it is a walking animation for a goblin and a 'spineboy') and using that example I managed to replace the character in our game with the same goblin (it's going to be the goblin until we manage to solve the collision detection etc).

So my concrete question is: I have the goblin displayed in the SFML window. I'd like to move it, let's say I hold the Right arrow key then it moves right with X speed utill the key is not released. Same with left and jumping.
I just don't know hot to change it's position.
It was easy using sf::Sprite, but I think it's type is sf::Drawable now. (SkeletonDrawable wich is an extension of sf::Drawable)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: SFML Spine
« Reply #3 on: April 23, 2014, 01:18:37 pm »
The SkeletonDrawable is getting its position information from the Skeleton, so all you need to do, it seems, is changing the skeleton position.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/