For my 2d fighting game I'm using the spine-c runtime libraries along with spine and I'm facing my ai skeleton in the opposite direction by flipping the skeleton's 'scaleX' property like so:
ai->worldPos = { (stage->info.size.width / 2.0f) + 300.0f, (stage->info.size.height / 2.0f) - 900.0f };
ai->skeleton->scaleX = -0.6f; // Flip ai fighter to start
ai->skeleton->scaleY = 0.6f;
However, later I found that when computing the world vertices of that same skeleton's bounding box for collision detection using 'spVertexAttachment_computeWorldVertices', the world vertices the function produced were in opposite order of my other player skeleton for which it's scaleX was not flipped. So calling computeWorldVertices for ai skeleton produced vertices like:
Vert1- TopRight
Vert2 - TopLeft
Vert 3 - BottomLeft
Vert 4 - BottomRight
and calling that for my other skeleton produced for which the scaleX was not flipped produced:
Vert1 TopLeft
Vert2 TopRight
Vert3 BottomRight
Vert4 BottomLeft
Needless to say this was causing some bugs in my program. My questions are:
1.) Is flipping the scaleX (or Y) the proper way to flip a skeleton in spine now that flipX and flipY seem to be deprecated?
if so
2.) Would the above issue be considered a bug or do I need to shift my understanding of the library a bit and use some other helper functions for this and other tasks?