- Editado
How Spine calculates the image vertices
I'm having some problems for calculate the image scale in my runtime.
All works when scaleX = scaleY.
But when scaleX != scaleY the bones work properly but the image is messed.
How the Spine's editor calculates the vertices?
See here:
https://github.com/EsotericSoftware/spi ... hment.java
First the region attachment has a width, height, and attachment offset SRT (which is relative to the bone the slot is on). 4 vertices for the image are precalculated in updateOffset(). Next, in updateWorldVertices(), the bone's world translation and 2x2 rotation matrix are applied to the offset vertices to get the vertices in world coordinates.
The rhomboid (diamond) shape for images occurs when the attachment offset rotation is not aligned with the bone and non-uniform scaling is applied (meaning x and y are not scaled the same amount):
Image removed due to the lack of support for HTTPS. | Show Anyway
Some game toolkits (like Corona) cannot draw rhomboids/quadrilaterals, they can only draw rectangles. For these toolkits, you can just avoid using non-uniform scaling in Spine, or if you do then make sure that your images are aligned with the bones. An easy way to do this is to click the Parent button, then set the rotation to 0, 90, 180, or 270.
Thanks, now I get it.
Remains only the animation system to complete my runtime for GameMaker.