Reputation: 91
I just wanted to ask i got a curve and i want to move it up but not sure if iam doing it correctly. I have made it below and set the color to orange.
var curvePath = paper.path("M690,124s20,15 10,19Z");
curvePath.attr({fill:"orange"});
Here i have tried to make it move up but iam not sure iam suppose to be using m or z.
var anim = Raphael.animation({y: 10 , x: 700}, 10000)
curvePath.animate(anim.delay(5000));
Thanks again for all the help.
Upvotes: 0
Views: 156
Reputation: 29005
Try something like this,
var c = paper.path("M10 10L90 90");
c.attr({fill:"orange"});
c.animate({'path' : {M: 10 , Z: 700}}, 10000);
You do not move paths on x
, y
. You mode them along a path.
EDIT: (after comments)
var curvePath = paper.path("M320,124s20,15 10,19Z");
curvePath.attr({fill:"orange"});
curvePath.animate({'path' : "M320,24s20,15 10,19Z"}, 10000);
Upvotes: 1