biminiroad Posted August 30, 2016 Report Share Posted August 30, 2016 Hello! I'm using this implementation https://github.com/indieSoftware/INSpriterKit as a basic for my Swift SpriterKit project, and am running into the same problem as the author trying to get bone scaling to work. I've looked at other implementations and it seems they all unmap relative positions and scales from parents. However SpriteKit applies a parent's properties onto its children already so I figured this wouldn't be an issue, but there are certain GreyGuy examples where bones without 1,1 scaling end up looking wrong. Has anyone run into anything similar? I can try explaining in more detail if there's any confusion, but any knowledge or guide in a general direction would be great. Thank you! Quote Link to comment Share on other sites More sharing options...
lucid Posted September 3, 2016 Report Share Posted September 3, 2016 Spriter uses rigid transformations and scaling to work on many 2d engines where sprites can't be skewed or distorted. Because of this, for each child, you need to apply scale before angle, to prevent 'squashing' and replicate the way it looks in Spriter. Scale * parentScale, Angle + parentAngle, Position * parentScale (rotated around parentPosition by parentAngle degrees) Quote Link to comment Share on other sites More sharing options...
biminiroad Posted September 3, 2016 Author Report Share Posted September 3, 2016 Thanks! That ordering might be it, but after some playing around, I believe it's all on SpriteKit itself. For anyone else that might be using it, I found this unresolved question on StackOverflow that seems similar: http://stackoverflow.com/questions/33770176/spritekit-node-zrotation-doesnt-keep-aspect-ratio-of-node-when-child-of-another#comment65871923_33770176 It might be expected behavior for SpriteKit, but applying rotations and scaling to ancestors morphs the child node. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.