Examples:
Set rotation 180, mirror about Y axis:
SetTransform(180, 1, 1)
Set rotation 180, mirror about X axis:
SetTransform(180, 2, 1)
Set rotation 180, mirror about X,Y axes:
SetTransform(180, 3, 1)
All arguments are numeric. If the first argument is nonzero, the current transformation will be used in subsequent calls to the functions listed above. If the first argument is zero, the current transform is ignored by these functions. The remaining arguments provide the translation applied to the object being created, before the current transform is applied.
If UseTransform(1, ...) has been given, ShowGhost will apply the current transform to the list of objects to display, using the pointer location as the translation rather than the x, y supplied to UseTransform, which are ignored. The other functions listed above will create the object after applying the current transform, using x, y.
In some scripts, it will be necessary to call UseTransform(1, ...) twice, once to enable ShowGhost, and again after the location for the new object is obtained. In particular, if Point is used to obtain the coordinate, UseTransform should be called before Point (so the ghost drawing will be accurate) and again with the coordinates returned from Point before the new object is created.
The Box function will actually create a polygon if the current transform is being used and the rotation angle is 45 degrees or one of the other non-Manhattan angles. The Polygon function will actually create a box if the rotated figure can be so represented. The Polygon function will never create boxes unless use of the current transform is enabled.
Below is an example script that will place boxes on the current layer where the user clicks. Note that the size and rotation angle of the box can be changed while in the script through the Transform Menu.
ShowPrompt("Click to place boxes") PushGhostBox(0, 0, 1, 1) UseTransform(1, 0, 0) while (1) ShowGhost(8) a[2] if !Point(a) ShowPrompt("") Exit() end ShowGhost(0) UseTransform(1, a[0], a[1]) Box(0, 0, 1, 1) Commit() end