-
Notifications
You must be signed in to change notification settings - Fork 85
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
Oscillating pin image when it collides with any of the separator #6
Comments
Do you mean a similar effect like on this project right? |
Yes, kind of.
Actually, I'm not interested for the anchor images. Can the collision effect be done relative to the separator between two slices? If yes, then I think your concern about "there can be zero or two anchors at the same time" can be left aside. In my case I need to have the collision effect whenever the Pin Image is being passed through by the purple lines (separator line to be exact). |
I will take into consideration this feature for future releases. Nevertheless, right now I can not announce the date when this will be done. |
Okay. Great. But can you consider adding a call back for any collision between the Pin & Separator? Something like below will be extremely helpful for my case:public class SwiftFortuneWheel: UIControl {
. . .
enum Rotation {
case clockwise
case counterClockwise
}
. . .
public var onCollisionWithSeparator: ((Rotation) -> Void)?
. . .
} With that, I can use it at the client side like:fortuneWheel.onCollisionWithSeparator = { rotation in
// TODO: play a sound / vibrate
// TODO: maybe implement a Pin image (added in the client side) collision
} If you don't think you can focus on this right now, can you please give me a head start for calculation of collision detection? |
I don't mind if you start. Do you have any idea, besides animation and sound, can this closure be useful for something else, that doesn't relate to SwiftFortuneWheel itself? In my opinion, it is better to implement these features, not on the client-side, but how a quick and temporary solution I don't mind. |
… updated, animation API updated, issue #6;
@sh-khashimov you are the man! Thanks a ton for this added feature. |
Can the pin image be oscillated?
Actually it should be like, the pin image rotates +θ / -θ degrees (depending on the direction of wheel rotation) and move back to original immediately after the collision imitating an oscillation effect.
I think a better visualisation would be these screenshots:
The text was updated successfully, but these errors were encountered: