Sg2.9
How to create a rectangle...
Recent RSS
How to create a rectangle...
From:  Kaue Costa
Date:  12. October 2008, 19:52

Hi everyone...

I need create a rectangle to make a mask of my objects...

But I dont know how make paths with scriptographer?

thanks in advance

Re: How to create a rectangle...
From:  hekama
Date:  13. October 2008, 20:44

Easiest way to use the Path object:

var myPath = new Path();

myPath.moveTo(100,100); //Starting point (x,y)
myPath.lineTo(200,100); // Draw a line to a new point
myPath.lineTo(200,200); //Continue to draw straight lines
myPath.lineTo(100,200);
myPath.lineTo(100,100);

Or perhaps:

var list = [Point(400,400),Point(400,500),Point(500,500),Point(500,400),Point(400,400)];
var newPath = new Path(list);

Try this out and then check out the reference section for the Path object at this site.

Re: How to create a rectangle...
From:  hekama
Date:  13. October 2008, 21:33

Not using the Path object but createRectangle() function instead:

var rect = new Rectangle(0, 0, 100, 100);
activeDocument.createRectangle(rect);

Scripts
08.08.14, 15:24
15.05.14, 14:23
02.03.14, 19:16
18.11.13, 14:48
22.03.13, 03:05
22.02.13, 15:45
Posts
10.01.17, 16:37
19.02.16, 06:03
19.02.16, 06:00
17.01.16, 11:00
12.01.16, 13:10
25.11.15, 08:19
Script of the Moment
Mosaic Staple Raster 24.03.10