• Editor
  • Flipping bones/textures in during an animation

Related Discussions
...

Hey peoples, First off I want to say I'm really enjoying spine and want congratulate you fine developers for making such a nice tool.

I'm part of a small dev team making 2d combat game called 'Honourbound' and I'm currently animating some characters in Spine to see how viable it will be and if the style of animation will work with the games tone. (I think it will and so far the results are pretty awesome) You can check out some of the stuff here if you want.

http://honourboundgame.tumblr.com/

Anyway I'm currently animating some attack moves where the character either has to turn 360 or there is a change in feet stance which requires his feet and torso to be flipped and facing the other way. Currently I can achieve flipping a bone or texture using the scale tool and giving it a negative x value. However this isn't ideal as its somewhat slow and then since the game runs at 60 fps theres a chance that for a single frame that x value will be 0 and the texture might pop (however that part still needs testing to see how bad it is)

I hope I explained that ok as I'm just finished for the day and am sleep

I'm just wondering does anybody know if I'm missing something or if there is a way to flip a texture or bone without scaling or having duplicates of the same texture?

Thanks yo!

Tom
NinjaMonkeyBrain

Wow, game looks amazing. Really looking forward to see more.
As for your question, I'm not 100% sure I'm following you but if I understand correctly you can use negative scaling on X and then make sure you set the interpolation to stepped. To do that select the previous key, then open the graph editor and set the curve to stepped. Doing it this way you won't see any frames where x = 0.
Keep in mind due to the way scaling works you can't flip an entire character with negative x (doing so will cause rotation values to look strange), but rather you do this at runtime with Skeleton.flipX - http://esotericsoftware.com/spine-using ... /#skeleton

Hope it helps.

HEY! Thanks so much! That pretty much solves it and I don't know why I didn't think of that. I just read my post again and I must apologise for the sheer amount of grammatical errors in there. I'm surprised you figured out what I was trying to achieve through that jumbled mess.

I'll definitely post up more artwork as we make progress on it as It would be cool to share feedback and whatnot.

Until next time.

Tom
-NinjaMonkeyBrain-

5 mois plus tard

I think I'm having a similar issue. I'm using the spine.js runtime with pixi and applied flipX = true to my spine skeleton. The animation does flip horizontally but all the textures remain the same.

Does the animation have to be setup a certain way in the editor in order to be 'flippable'?

I thought maybe it had something to do with my animation but I applied flipX to one of the pixi/spine examples with the same result.

Using chrome tools I set a break point on line 89 of (index) on this page http://www.goodboydigital.com/pixijs/examples/12-2/ then in the console applied flipX like so:
stage.children[0].skeleton.flipX = true;

Some things I've tried to solve this:

  1. called updateWorldTransform() on the skeleton after flipX
  2. looped through all slots and set scale.x = -1 on all the sprites.

I had some success with #2 but positioning of the textures seems off.

Any help on this would be greatly appreciated 🙂

-Jared

Are you using skeleton x/y or the root bone to position your skeleton?