ImagineEngine
ImagineEngine copied to clipboard
Rotate Actor around pivot point.
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:
Hey there @fortmarek I figured that out
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
Thanks! Maybe it would be great if this was made available as a public property, @JohnSundell? 😄
@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 🙂
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 🙂