user2397282
user2397282

Reputation: 3818

Raphaeljs - Animate set transform

I am making an animation using Raphaeljs. I have a set with a circle and a rectangle inside. I can rotate the set easily, but I don't know how to animate this rotation.

Here is my code:

var gun = paper.set();
gun.push(
    paper.circle(550, 400, 70)
         .attr({ fill: "85FFA5" }),
    paper.rect(510, 350, 80, 100, 5)
         .attr({ fill: "E8E8E8" })
);

gun.transform("R45, 550, 400");

How do I animate that last line?

Upvotes: 0

Views: 391

Answers (1)

crockz
crockz

Reputation: 231

gun.animate({
  transform: "R45, 550, 400"
}, 1000);

1000 is the time in miliseconds

Upvotes: 1

Related Questions