ImagineEngine icon indicating copy to clipboard operation
ImagineEngine copied to clipboard

Rotate Actor around pivot point.

Open fortmarek opened this issue 7 years ago • 4 comments

I would like to rotate Actor with UIImage to rotate around a defined pivot point but I have not been able to find how to achieve this.

When I tried to find a solution, the best answer was this: https://stackoverflow.com/questions/27658454/swift-rotating-an-image-in-an-uiimageview-defined-in-the-main-storyboard

What I am trying to achieve:

demo

fortmarek avatar Jan 31 '18 19:01 fortmarek

Hey there @fortmarek I figured that out jan-31-2018 18-09-22 Check out CALayer's anchorPoint. Actor has a private layer property. Just set a new value (create a public variable 😁 ). EDIT: if you need more info just let me know

Alex88WH avatar Jan 31 '18 20:01 Alex88WH

Thanks! Maybe it would be great if this was made available as a public property, @JohnSundell? 😄

fortmarek avatar Jan 31 '18 21:01 fortmarek

@fortmarek Yeah sounds great, feel free to implement it as a public property on Actor and send a PR👍 Just like opacity, cornerRadius etc it can just forward the value directly to the layer 🙂

JohnSundell avatar Feb 01 '18 10:02 JohnSundell

Just one thing to keep in mind is that this property may behave a bit differently on macOS compared to iOS+tvOS, due to coordinate system differences. Just something to test for as this is being implemented 🙂

JohnSundell avatar Feb 01 '18 10:02 JohnSundell