I am quite new with createJS - I want to achieve like a countdown timer animation:
I stumbled upon this issue which have this fiddle - I want to achive something like this but I want to create an arc shape:
I tried adjusting the code and changed the point values but it only gave me a diamond one instead of a perfect curve.
Do I need to point every values to achieve a perfect circle like:
points = [{x: 50, y: 0}, {x: 51, y: 1}, {x:52, y: 2}, ...etc]
Or is there other way (maybe a function or plugin) that does this stuff? I wasn't able to find anything on their documentation
You might be interested in using an
arc()graphic, along with the EaselJS "Command" approach to graphics:1) Create a full arc
2) Store off the last "command"
3) Set the command
endAngleto 0. You can do this in the arc() method too4) In your animation, increment the
endAngleover time. In this example I normalize 100 to mean 100% of the radius (Math.PI*2)Here is a quick fiddle: https://jsfiddle.net/lannymcnie/pgeut9cr/
If instead you just want to animate the circle over a fixed period, you can tween the
endAnglevalue. Here is an example using TweenJS: https://jsfiddle.net/lannymcnie/pgeut9cr/2/Cheers,