Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rotate Actor around pivot point. #164

Open
fortmarek opened this issue Jan 31, 2018 · 4 comments
Open

Rotate Actor around pivot point. #164

fortmarek opened this issue Jan 31, 2018 · 4 comments

Comments

@fortmarek
Copy link

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 fortmarek changed the title Rotate Actor around pivot point. Rotate Actor around pivot point. label:"help wanted" Jan 31, 2018
@fortmarek fortmarek changed the title Rotate Actor around pivot point. label:"help wanted" Rotate Actor around pivot point. Jan 31, 2018
@Alex88WH
Copy link
Collaborator

Alex88WH commented Jan 31, 2018

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

@fortmarek
Copy link
Author

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

@JohnSundell
Copy link
Owner

@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
Copy link
Owner

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 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants