This is a TransformTool similar to the one in PhotoShop, Ilustrator, Flash etc. that allows to you to rotate or scale any Display Object at runtime.
package {
import flash.display.MovieClip;
import flash.geom.Rectangle;
import classes.quietless.tools.TransformTool;
public class ApplicationMain extends MovieClip
{
private var _transformTool;
public function ApplicationMain ()
{
_transformTool = new TransformTool();
_transformTool.mode = TransformTool.ROTATE;
_transformTool.iconScale = new HandleHintScale();
_transformTool.iconRotate = new HandleHintRotate();
_transformTool.boundaries = new Rectangle(50, 50, 475, 260);
addChild(_transformTool);
// register targets //
_transformTool.targets = [sprite1, sprite2, sprite3];
_transformTool.activeTarget = sprite2;
}
}
}_mode : String
Currently there are two modes to this tool, 'scale' and 'rotate'. In a future version I will remove the need to select between them. For now you will have to create a button or some logic that toggle modes between the two modes as demonstrated in the sample files.
_targets : Array
An array of display objects that can receive mouse events, e.g. Sprites & Movieclips
_target : DisplayObject
Sets a new target for the TransformTool to affect. This can be any custom class that extends DisplayObject
_boundaries : Rectangle
The default value is the stageHeight and stageWidth. You can optionally constrain where the target can be dragged by setting this property at runtime.
_iconScale : DisplayObject
This is any library item graphic that you would like to represent the scale mode icon when the target is rolled over.
_iconRotate : DisplayObject
This is any library item graphic that you would like to represent the rotate mode icon when the target is rolled over.
_maxScale : Number
A number (percentage based) that the target can be scaled out to. This value must be larger than whatever you set minScale to.
_minScale : Number
A number (percentage based) that the target can be scaled down to. This value must be smaller than whatever you set maxScale to.