• Editor
  • Recent commits broke flipping?

I don't think I should have to understand all the nuances of the root bone to use spine. It sounds like the root bone also means too many things and has conflicting uses. Anytime I find something like this in my code I know I'm asking for trouble.

I think all the runtimes should support positioning a skeleton in the same way they all support positioning sprites or whatever objects they have in their engines. Its not really productive to have to understand the way spine does positioning so I can then position the skeleton where I want it to be. At that level the skeleton should just be another object not something that I have special understanding of. I also think you are asking for a support nightmare if everyone has to write their own "make the spine skeleton position correctly" in my game engine code. There will be an endless supply of forum posts asking why my skeleton is not positioned where I want it to be. And please don't get me wrong I know I can figure out how to do it no matter what you provide but you really probably know better than me how varied the spine user skillset is going to be.

For example, in Cocos2d, I should be able to set the position and anchorpoint of the AnimationNode just like I can any other node and the skeleton should work like I expect. So if I set the anchorpoint to 0.5,0.5 and then set the position of the AnimationNode to the middle of the screen the skeleton should be centered on the screen.

Related Discussions
...
Barry escribió

For example, in Cocos2d, I should be able to set the position and anchorpoint of the AnimationNode just like I can any other node and the skeleton should work like I expect. So if I set the anchorpoint to 0.5,0.5 and then set the position of the AnimationNode to the middle of the screen the skeleton should be centered on the screen.

Sort of. A skeleton doesn't have a (meaningful) center, since it is animating and (almost always) changing size. You need a reference point in the editor so when you place your character it is relative to that point. Eg, typically with a standing character you want the reference point between the feet. We are discussing whether this reference point should be 0,0 in global space or the root bone. There won't be any special nuances you have to deal with, have a little faith. :*

terryhau escribió

When i say 'Flipping around the axis that is local to the skeleton', i meant, the axis that you see in the spine editor. IE, if you placed your root bone, 5 units to the right of the origin in spine editor, at run time it would flip around the point 5 units to the left of the root bone no matter where it was positioned.

The axes you see in the editor are 0,0 in global space. The root bone is positioned in global space, this is why flipping global space messes up where you have positioned the root bone.

Do you mean just giving the skeleton a position attribute?

Yes. I think this is the best way to handle it. The two options are not so different, but this option is slightly more efficient. It is basically what you described. Giving it a go right now.

20 días más tarde

I finally have made these changes. Flip now flips the root bone around the origin. Use skeleton x/y to position your skeleton, not the root bone. It is no longer necessary to leave the root bone at 0,0 and unkeyed.

What is the origin now? The middle line in the editor or sth? Or is it calculated?

What's sth?

sth = something 🙂 Old habit. 🙂

The origin in Spine is 0,0. When you place the skeleton at x,y you are placing the origin in Spine at that position. So, use 0,0 in the editor as a reference point for positioning your skeleton at runtime.

OK. Thanks. That should make things easier.

hey quick question from a novice!! does this 'flipping' mean that i can take my skeleton with it's images and in effect have all the components mirrored to give the appearance that it's now facing in the opposite direction??

to give an example of how i'd love to use this. I have a character walking left-> right, they then encounter a collision object. On encountering this, they about turn. This then has the character facing right->left. I could then take this new flippeed position and either make the character walk in the opposite direction OR walk backwards.

Is my understanding correct??

cheers
jim

Yes, flipping changes rendering so everything is drawing facing the other way.

thanks nate i thought that was how it worked -perfect (again)

thanks
jim

btw - is it possible to test this out inside the GUI when creating an animation, or is this api runtime process only??

Runtime only for now.

thanks -look fwd to GUI version soon then 🙂

actually, it would be a VERY useful addition to the xml (related to the animation), to have a property on the timeline that indicated that (e.g at 00:00:02:23) the skeleton flipped x|y. This way, I could design inside the GUI and use the dopesheet to insert an 'event' that flipped the orientation of the animation until flipped back (or indeed had a duration to the inserted event).

I hope I'm clear in what I'm expressing here!?

You could do that with the event timeline, when it is done.