| Have a look at and learn http://www.w3.org/Graphics/SVG/ because SVG path syntax is the only parameter for the path method. You can manipulate the position of your polygon with the "M" command using the attr method. Note the "M" command's new "xy" parameter will be different from previous and will be at the front of the single parameter you present to the "path" method. The remainder of the parameter will consist of your changed or unchanged polygon information. "cx" and "cy" are attributes of the circle primitive and should not be used. In the documentation I noticed that it says circleParameters
--- On Mon, 11/9/09, LudoO <ludovic...@gmail.com> wrote: |
|
since raphaeljs has some really nice functions hidden in it this is
the only way I could use them and keep my code small... anyways to use
it:
- create a path: var p = paper.path(.... path stuff here...);
- now you can move it like this: p.moveTo(100, 100);
I made it so that the position pivot was the top left most point in
the path, since the path's origin point can be anywhere on the canvas.
Hope this helps someone!
btw, those nice functions in raphaeljs need not be hidden. can we
please have them available for use plugin writters?
On Nov 10, 3:12 am, LudoO <ludovic.vale...@gmail.com> wrote:
> ok,
> I keep this in mind, i do a mistake by reading docs too fast.
>
> But i search for a method of raphael which can do this.
> I didn't want to manipulate svg element by myself !
>
> I hoped that raphaeljs wraps access to svg in a certain homogeneity.
> Could we move an item using a moveTo(x, y) or attr({x:10, y:20})
> method , whatever element type (circle,path...)?
>
> Thanks
>
> On Nov 9, 5:36 pm, charles thomas <charles...@yahoo.com> wrote:
>
> > Have a look at and learnhttp://www.w3.org/Graphics/SVG/becauseSVGpathsyntax is the only parameter for thepathmethod.
>
> > You can manipulate thepositionof your polygon with the "M" command using the attr method.
note: some of you might be using raphael.path.methods.js since it is
included in a lot of examples. Inside that plugin there is already a
moveTo function which will take precedence. raphael.path.methods.js
moveTo must be for something else since it does not actually move
anything. Solution just rename this function to something else.
> > > Have a look at and learnhttp://www.w3.org/Graphics/SVG/becauseSVGpathsyntaxis the only parameter for thepathmethod.