To animate a shape's rotation with KineticJS, we can create a new animation with Kinetic.Animation, and define a function which modifies the shape's rotation with each animation frame.
In this tutorial, we'll rotate a blue rectangle about the top left corner, a yellow rectangle about its center, and a red rectangle about an outside point.
Code Editor
Modified on April 9th, 2013
by Eric Rowell