Sg2.0
Document
Packages

Constructors

Opens an existing document.
Parameters:
file: File - the file to read from
colorModel: Number - the document's desired color model, Color.MODEL_* values
dialogStatus: Number - how dialogs should be handled, Document.DIALOG_* values
Creates a new document.
Parameters:
title: String - the title of the document
width: Number - the width of the document
height: Number - the height of the document
colorModel: Number - the document's desired color model, Color.MODEL_* values
dialogStatus: Number - how dialogs should be handled, Document.DIALOG_* values

Properties

Read-only.
Returns:
Read-only.
Returns:
Read-only.
Returns:
Read-only.
Returns:
Returns:
Returns:
Object
Read-only.
Returns:
Read-only.
Returns:
Array of String
Read-only.
Returns:
Read-only.
Returns:
Read-only.
Returns:
Returns:
Boolean
Returns:
Read-only.
Returns:
Read-only.
Returns:
Returns:
Read-only.
Returns:
Returns:
Read-only.
Returns:
TextStoryList
Read-only.
Returns:
Read-only.
Returns:
Read-only.
Returns:
Read-only.
Returns:
Number
Returns:
Number
Returns:
Number
Returns:
Number

Functions

Activates this document, so all newly created art objects will be placed in it.
Parameters:
focus: Boolean - When set to true, the document window is brought to the front, otherwise the window sequence remains the same.
Closes the document
Copies the selected items to the clipboard
Parameters:
area: Path
orient: Number
Returns:
Parameters:
x: Number
y: Number
radius: Number
Returns:
Parameters:
center: Point
radius: Number
Returns:
Parameters:
children: ExtendedList
Returns:
Parameters:
children: Array of Art
Returns:
Parameters:
shape: Shape
Returns:
Parameters:
children: ExtendedList
Returns:
Parameters:
children: Array of Art
Returns:
Returns:
Creates an oval shaped path
Parameters:
rect: Rectangle
circumscribed: Boolean - if this is set to true the oval shaped path will be created so the rectangle fits into it. If it's set to false the oval path will fit within the rectangle.
Returns:
Path - the newly created path
Parameters:
segments: ExtendedList
Returns:
Parameters:
path: Path
orient: Number
Returns:
Parameters:
point: Point
orient: Number
Returns:
Parameters:
type: Number
width: Number
height: Number
Returns:
Creates a rectangular path
Parameters:
rect: Rectangle
Returns:
Path - the newly created path
Creates a regular polygon shaped path
Parameters:
numSides: Number - the number of sides of the polygon
center: Point
radius: Number
Returns:
Path - the newly created path
Creates a rectangular path with rounded corners
Parameters:
rect: Rectangle
hor: Number
ver: Number
Returns:
Path - the newly created path
Creates a spiral shaped path
Parameters:
firstArcCenter: Point - the center point of the first arc
start: Point - the starting point of the spiral
decayPercent: Number - the percentage by which each succeeding arc will be scaled
numQuarterTurns: Number - the number of quarter turns (arcs)
clockwiseFromOutside: Boolean - if this is set to true the spiral will spiral in a clockwise direction from the first point.
If it's set to false it will spiral in a counter clockwise direction
Returns:
Path - the newly created path
Created a star shaped path The largest of radius1 and radius2 will be the outer radius of the star. The smallest of radius1 and radius2 will be the inner radius.
Parameters:
numPoints: Number - the number of points of the star
center: Point
radius1: Number
radius2: Number
Returns:
Path - the newly created path
Cuts the selected items to the clipboard
Deselects all the selected items in the document.
Parameters:
type: Class
attributes: Object
Returns:
Checks wether the document contains any selected items.
Returns:
Boolean - true if the document contains selected items, false otherwise.
Parameters:
point: Point
type: Number - HitTest.TEST_*
tolerance: Number
Returns:
Invalidates the rectangle in artwork coordinates. This will cause all views of the document that contain the given rectangle to update at the next opportunity.
Parameters:
x: Number
y: Number
width: Number
height: Number
Parameters:
rect: Rectangle
Pastes the selected items to the clipboard
Places a file in the document
Parameters:
file: File - the file to place
linked: Boolean - when set to true, the placed object is a link to the file, otherwise it is embedded within the document
Returns:
Art
Prints the document
Parameters:
dialogStatus: Number - Document.DIALOG_*
Forces the document to be redrawn
Text reflow is suspended during script execution. when reflowText() is called, the reflow of text is forced.
Saves the document
setSize only works while reading a document!
Parameters:
width: Number
height: Number
Parameters:
file: File
format: String
ask: Boolean
Returns:
Boolean