Hi i want to build a loading animation, where a Doughnut Chart is becoming bigger and bigger. I need to do this with a custom shape, because i need the hole in the middle for other animations. What i get so far is:
var stage = new Kinetic.Stage({ container: 'loader', width: 600, height: 200 });
var layer = new Kinetic.Layer();
var circle = new Kinetic.Circle({ x: stage.getWidth() / 2+200, y: stage.getHeight() / 2, radius: 70, fill: 'red' });
var x = stage.width / 2; var y = stage.height / 2; var radius = 75; var startAngle = 1.1 * Math.PI; var endAngle = 1.9 * Math.PI; var counterClockwise = false;
var arc = new Kinetic.Shape({
sceneFunc: function(context) { context.beginPath(); context.arc(x, y, radius, startAngle, endAngle, counterClockwise); context.closePath(); // KineticJS specific context method context.fillStrokeShape(this); }, fill: 'green', stroke: 'red', strokeWidth: 4 });// add the shape to the layer
layer.add(arc);
// add the layer to the stage stage.add(layer);
if some body could help me would be great
here is my fiddle: http://jsfiddle.net/FabuBaracus/D9j3S/