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

Is there a option to animate pointer on Fortune wheel ? #72

Open
AshokRamaraja opened this issue Apr 23, 2019 · 3 comments
Open

Is there a option to animate pointer on Fortune wheel ? #72

AshokRamaraja opened this issue Apr 23, 2019 · 3 comments

Comments

@AshokRamaraja
Copy link

I want to try animate the pointer when the wheel starts rotating. Pointer needs to tick each time it passes through each segment. I am planning to use the pointer as separate image. Kindly share your thoughts.

@shankara-subramani
Copy link

I need this too. Is there anyway to achieve this?

Please help.

@zarocknz
Copy link
Owner

zarocknz commented Dec 7, 2019

There is no one-line option for this. But it should be possible combining a couple of existing features with some custom code...

You will need to draw the pointer on the canvas, please see this tutorial: http://dougtesting.net/winwheel/docs/tut10_pointers_and_backgrounds in particular the "Draw a triangle or other shape on the canvas" section. Create a function to draw your pointer.

Then use the feature explained in this tutorial http://dougtesting.net/winwheel/docs/tut19_playing_sounds_and_music "'Tick' sounds with callbackSound" and in the playSound() function set a variable so your code which draws the pointer draws it differently. For example as if it has been bumped by one of the pins. Then reset this variable after 1 second or so.

From there you can experiment with improving the animation, perhaps by animating the rotation of the pointer so it appears to swing out from the pin and then back to straight.

@masoumii
Copy link

I just added a custom img and positioned it absolute on top of the wheel, then used the callBackSound method to animate the pointer up and down based on how often pins touch the pointer.

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

No branches or pull requests

4 participants