Winwheel.js tutorial: #12 Spinning a Wheel - More Details


//++ This tutorial to be completed. In the meantime perahps look at the Animation class reference for some more details.


In this tutorial we will go in to more details of the animation properties and options for spinning a wheel and then do something to alert the user of the prize they have won when the spinning stops.


All GreenSock animations happen over time, so one thing you will always set is the duration of the animation via the duration parameter. The value is in seconds and can be a whole or decimal number.



Animation Types and Properties


There are a number of properties which control the animation, many you don't normally need to worry about because for each Type of animation there are sensible defaults and you would just specify one or two of these, but I will detail all of them here.


There are currently 4 animation types built in to Winwheel Library, use the type property to specify which one you want to use...


As well as these main "Types" of animation, there are a number of other animation parameters that you should or could set which will affect how the animation works, these are...


Property defaults for each animation type

Lets have a look at what the defaults are for each of the animation types so you can get a feel for how the properties are used, you could then experiment with different values for them in your project and see how it affects the animation.


//++ to complete.
Spin to stop
Spin and Back
Spin ongoing
Custom (none are set, but what you could do - outer radius thing).


< #11 Animation Introduction and Spinning Basics #13: Getting the segment (prize) pointed to >