Winwheel.js class reference: Helper Functions
There are a few functions not part of the Winwheel.js classes. One can be helpful when specifying the size of a segment in the options structure passed to the Winwheel constructor. Two are to overcome issues I encountered when trying to run the animation loop from inside the Winwheel class. And the last helps with image loading.
You should not ever need to call/use all but the first function directly. The others have been documentated as well simply for the sake of completeness.
This function takes a percent of 0-100 and converts this in to degrees of arc 0-360. Useful when setting segment sizes for pie graphs where the size of a segment needs to equate to a percentage of 100.
let degrees = winwheelPercentToDegrees(float percentValue);
|percentValue||Value in the range of 0-100%.|
Returns: a number representing the size of a segment in degrees of arc.
See tutorial #16 Creating Pie graphs for an example.
Called by the Greensock Tween animation each frame. This in turn calls the Winwheel.draw() function to render changes to the wheel by the animation to the canvas. Also if there is a callbackAfter function specified in the animation properties it will call it.
Used to stop the animation by unhooking the animation loop function from Greensock's 'tick' event. Then if a callbackFinished function is specified in the animation properties it calls it.
Used by the code that loads up the images for One Image Per Segment wheels, called when a segment image has completed loading. If all the images needed for the wheel are loaded it then calls the draw() method on the wheel.
Used by the responsive feature of the wheel. If the responsive property of the wheel is set to true an event listener for window.load and window.resize is added which calls the winwheelResize function.
< Pointer Guide Class Reference
Documentation index >