# Transform Methods
The Transform method is used to change the positioning, rotation, shear-angle, and scaling of document art according to Illustrator UI's Transform dialog feature as well as the Transform Panel.
The transform
method not only embodies all the actions one can perform with Illustrator's Transform dialog or the Transform Panel (basic/non-shape options), it allows for sending properties related to different variations of the Transform dialog/panel all in one column.
For instance, the Move command's parameters could be sent in along with some parameters of the Rotate dialog.
Note: As the Darty-Ai tagging mechanism allows for setting the same tags on multiple items, this method effectively simulates Illustrator's "Transform-Each" dialog except for the "Random" parameter at this time.
# Transform - Positioning
The following parameters are used to change an object's position on the artboard explicitly by setting the coordinate through data:
Note: Artboard-specific positioning coming soon...
# Positioning Example Spreadsheet
star | ||||||
transform | ||||||
x | y | anchorPoint | changeStrokePattern | scaleStrokes | changeFillPatterns | transformObjects:true |
50 | 50 | CENTER | TRUE | TRUE | TRUE | |
CENTER | TRUE | TRUE | TRUE | |||
50 | 50 | TOPLEFT | TRUE | TRUE | TRUE | |
TOPLEFT | TRUE | TRUE | TRUE | |||
50 | 50 | CENTER | TRUE | TRUE | TRUE | FALSE |
CENTER | TRUE | TRUE | TRUE | FALSE |
# Transform - Translation
These parameters are used to move an art-item relative to its current location in the document. All parameters not involving rotation angle in this sub-set of transform
parameters are change-values which will calculate against the object's current measurements.
# Translation Example Spreadsheet
star | ||||||||
---|---|---|---|---|---|---|---|---|
transform | ||||||||
deltax | deltay | angle | distance | anchorPoint | changeStrokePattern | scaleStrokes | changeFillPatterns | transformObjects:true |
50 | 50 | CENTER | TRUE | TRUE | TRUE | |||
72 | 50 | CENTER | TRUE | TRUE | TRUE | |||
50 | 50 | TOPLEFT | TRUE | TRUE | TRUE | |||
72 | 50 | TOPLEFT | TRUE | TRUE | TRUE | |||
50 | 50 | CENTER | TRUE | TRUE | TRUE | FALSE | ||
72 | 50 | CENTER | TRUE | TRUE | TRUE | FALSE |
# Transform - Rotation
The parameter rotation
turns the art object about itself.
# Rotation Example Spreadsheet
star | |||||
---|---|---|---|---|---|
transform | |||||
rotation | anchorPoint | changeStrokePattern | scaleStrokes | changeFillPatterns | transformObjects:true |
72 | TOPLEFT|TRUE | TRUE | TRUE | ||
72 | CENTER|TRUE | TRUE | TRUE | ||
72 | TOPLEFT|FALSE | FALSE | FALSE | ||
72 | CENTER|FALSE | FALSE | FALSE | ||
72 | TOPLEFT|TRUE | TRUE | TRUE | FALSE | |
72 | CENTER|TRUE | TRUE | TRUE | FALSE |
# Transform - Shear
These parameters skew the art item with a specified angle.
# Shear Example Spreadsheet
star | ||||||
---|---|---|---|---|---|---|
transform | ||||||
shearh | shearv | anchorPoint | changeStrokePattern | scaleStrokes | changeFillPatterns | transformObjects:true |
10 | 10 | CENTER | TRUE | TRUE | TRUE | |
20 | 20 | CENTER | TRUE | TRUE | TRUE | |
10 | 10 | TOPLEFT | TRUE | TRUE | TRUE | |
20 | 20 | TOPLEFT | TRUE | TRUE | TRUE | |
10 | 10 | CENTER | TRUE | TRUE | TRUE | FALSE |
20 | 20 | CENTER | TRUE | TRUE | TRUE | FALSE |
# Transform - Scaling
These paremeters control the scale of the art item.
# Scale Example Spreadsheet
star | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
transform | |||||||||||
scaleH | scaleV | keepProportions | widthDiff | heightDiff | width | height | scaleStrokes | anchorPoint | changeStrokePattern | changeFillPatterns | transformObjects:true |
50 | TRUE | FALSE | CENTER | TRUE | TRUE | ||||||
50 | FALSE | ||||||||||
1" | TRUE | TOPLEFT | TRUE | TRUE | |||||||
TRUE | 100pt | CENTER | |||||||||
300 | TRUE | CENTER | TRUE | TRUE | |||||||
TRUE | 2cm | FALSE | CENTER | TRUE | FALSE | FALSE | |||||
TRUE | 2cm | TRUE | CENTER | TRUE | FALSE | FALSE | |||||
50 | 50 | TRUE | CENTER | TRUE | TRUE | ||||||
20 | 60 | TRUE | CENTER | TRUE | TRUE | FALSE |
# Transform - All Properties
These properties are applicable to any transform
operation. They modify the visual transformation process to produce unique results according to the kind of artwork being affected and instructions being sent in.
Parameter | Description |
---|---|
anchorPoint | This is the art-object's bounding box coordinate to transform from. |
keepProportions | The keepProportions parameter enforces a proportional scaling operation in the cases where a height or width are not both specified (if only height was specified at 50%, the omitted width would be automatically filled-in with 50%).If both height and width (any of these or their vertical counterparts: scaleH , width or widthDiff ) are specified and keepProportions is set to TRUE , the width-based parameter is accepted as the value to proportionally fit the height. |
x | The x-coordinate on the artboard. The object will align to this horizontal axis point. |
y | The y-coordinate on the artboard. The object will align to this vertical axis point. |
deltaY | Moves the object on the vertical axis. |
deltaX | Moves the object on the horizontal axis. |
angle | When the distance parameter is used in conjunction with angle , the item is translated that distance amount at the angle specified, while maintaining the original artwork's intrinsic rotation.Use the rotation parameter to additionally rotate the object about itself if required. |
rotation | Rotates the art object about itself. Note: This is not the same as the angle parameter that controls the angle of the item's translation when using the distance parameter. |
shearH | Horizontal shear angle. |
shearV | Vertical shear angle. |
scale | Scale. |
scaleH | Horizontal scale. |
scaleV | Vertical scale. |
scaleCorners | Whether or not to scale corners. |
width | Value to set the item's width to. |
height | Value to set the item's height to. |
widthDiff | Scale the item's width to 100% of its current width plus this value. |
heightDiff | Scale the item's height to 100% of its current height plus this value. |
usePreviewBounds | Bases the transform on art-objects' bounds as defined by strokes and effects protruding out of the underlying vector shape. |