How can I move Raphael.js sets to specific locations?

xpTo.

New Member
If I were animating an individual element with raphael.js to a specific location, then I could use the following code that sets the elements \[code\]x\[/code\] attribute:\[code\]elem.animate({x: specific_X_Location}, 1000);\[/code\]but I have found no way to move a \[code\]set\[/code\] to a specific location.There are two SO articles:accessing a set inside a set in raphael js, and
How is set animation done in Raphael?
that discuss how to translate a set a given distance (i.e. move the set right by 100, or up by 100) which use transformation or translation, e.g.\[code\]var mySet = paper.set();mySet.push(...add elements to set);mySet.animate({transform: "t100,0"}, 1000); // move my set right by 100\[/code\]but there doesn't seem to be a way to move the whole set to a specific location.Looking at things in firebug, I guess a set is just an array in the end, which is why is doesn't have \[code\]x\[/code\] or \[code\]y\[/code\] attributes.Is it possible to access any information about the elements of the set without addressing them individually?In order to transform a set to a specific location, do you think I will have to work out the transformation for a specific element and then apply that movement to the whole set? Or is there a better way that I've missed?Thanks a lot
 
Back
Top