d13 Posted July 12, 2014 Share Posted July 12, 2014 I need to keep a child sprite's position and rotation aligned to its parent.So if the parent rotates, the child should maintain the correct position and rotation. Does anyone know what the formula for this is? Thanks! Quote Link to comment Share on other sites More sharing options...
d13 Posted July 15, 2014 Author Share Posted July 15, 2014 I got an answer to this on Stackoverflow: http://stackoverflow.com/questions/24748667/reposition-a-sprite-relative-to-its-parents-position It turned out to be really simple, I was just overthinking it.All you do is draw the parent's children between the same save() and restore() canvas call.As long as you have both local and global x/y co-ordinates to help with the positioning, it's very easy to implement. 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.