tapptitude / TTFortuneWheel-iOS

Fortune spinning wheel that supports custom drawing.
MIT License
132 stars 41 forks source link

Couldn't know what slice it will land #1

Closed gauuni closed 6 years ago

gauuni commented 6 years ago

HI, I really love your project. But there's still somethings I don't understand. Please show me.

  1. I'm using function startAnimating(fininshIndex:Int = 0, _ completion:((Bool) -> Void)?) but it didn;t land on right slice and landing on just same slice everytime
  2. How to customize where the needle is? I would like the need will be in the middle of wheel.

Thanks alot

EfraimB commented 6 years ago

Hello gauuni, Thanks for your feedback.

  1. By default the first index corresponds with the slice whose texts is written horizontally at 0 angle. The indexes of the slice will remain the same and do not change by rotating the wheel. So by calling open func startAnimating(finishIndex: completion) with the same index multiple times you will end up on the same slice every time.

  2. You can edit where the initial slice is drawn by setting initialDrawingOffset. If you want the needle to be in the middle of the wheel you have to offset the initial slice by 90 hence you have to set initialDrawingOffset to 90.0.

gauuni commented 6 years ago

I’m appreciate that And one more thing. Could we make vertical text like this. The vertical one, not horizontal


Best regards,

Nguyen Khoi Nguyen

Phone: +8401227513733

SkypeID: khoinguyeniosdev

On Dec 29, 2017, at 7:13 PM, Efraim Budusan notifications@github.com wrote:

Hello gauuni, Thanks for your feedback.

By default the first index corresponds with the slice whose texts is written horizontally at 180 angle. The indexes of the slice will remain the same and do not change by rotating the wheel. So by calling open func startAnimating(finishIndex: completion) with the same index multiple times you will end up on the same slice every time.

You can edit where the initial slice is drawn by setting initialDrawingOffset. If you want the needle to be in the middle of the wheel you have to offset the initial slice by 90 hence you have to set initialDrawingOffset to 90.0.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

EfraimB commented 6 years ago

Hi, We currently support only horizontal text but can add that in a future update. Please open another issue on this one. Thank you!

minhtuongitc commented 5 years ago

I change it in view did load: spinningWheel.initialDrawingOffset = 90

:D