You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no built in function for that, so the way to do this is to add this function to your html page...
// This function returns the center angle of the specified segment.functiongetCenterForSegment(segmentNumber){varstopAngle=0;if(segmentNumber){if(typeoftheWheel.segments[segmentNumber]!=='undefined'){varstartAngle=theWheel.segments[segmentNumber].startAngle;varendAngle=theWheel.segments[segmentNumber].endAngle;varrange=(endAngle-startAngle);if(range>0){stopAngle=Math.floor(startAngle+range/2);}}}returnstopAngle;}
Then in the code which sets the stopAngle before the spinning starts, instead of calling getRandomForSegment as seen in the tutorial http://dougtesting.net/winwheel/docs/tut14_setting_the_prize call the getCenterForSegment function instead passing in the segment number
// Set the stopping location to the center of a segment by calling the function below.theWheel.animation.stopAngle=getCenterForSegment(3);
i need to set like this when its stop spining then its wheel come on center like not any different engle
The text was updated successfully, but these errors were encountered: