Hello!
See simple example how to add graphic elements as target of transformation for tool.
Press view source context menu to get source code.
SWC: Transform Tool 2 version 2.5.0.
Source code: Project home page.
ASDoc: API ASDoc.
Required Flex SDK version: SDK 4.5
Hi Volodymyr, you have developed excellent transformation tool.
ReplyDeleteWhat I need to know that is there any way to apply transform constraints? I mean is it possible to restrict the transformation only to position, or scale or rotation?
Thanks & Regards,
Farhan.
you need tool that will for example only move objects but not resize and rotate, correct?
Deletecorrect!!!
DeleteYou need to create your custom skin. Best way would be to copy existing one from tool source code http://transform-tool.googlecode.com/svn/trunk/TransformTool/src/com/vstyran/transform/skins/TransformToolSkin.mxml and remove controls that you don't wont to see.
DeleteThanks a lot. I really appreciate your quick response :)
DeleteSir please tell me how you have implemented custom skin?
DeleteHi Volodymyr,
ReplyDeletePlease help me with this. thing is i am adding these shapes like in whiteboard using
mc = new UIComponent();
mc.graphics.lineStyle(2*5, 0x000000);
mc.x = top_x;
mc.y = top_y;
designCanvas.addChild(mc);
mc.graphics.beginFill(0xdcdcd7)
mc.graphics.drawEllipse(0,0,mc.mouseX,mc.mouseY;
mc.graphics.endFill();
and then adding tranform tool to resize and rotate them. it works fine when draw the shape on canvas starting top left to down right. tranform tool wraps it up but donot wraps other way. below in complete code. just give me any hint or some thing how to over come it. thanks, how can i post the code?
I'm not sure that I understand the problem, please send me details on email vstyran@gmail.com
DeleteThanks Volodymyr, i figure that out myself..
ReplyDeletemake sure that you draw in positive coordinates, tool takes care only about x,y,width... of traget.
DeleteThis comment has been removed by the author.
DeleteThis comment has been removed by the author.
ReplyDeleteFirst of all, Thank you for providing such a wonderful library for transformation and rotation issues.
ReplyDeleteI am bothering you for a problem I am facing; please help.
I am drawing graphics (ellipse, rectangle, line). I am using Flex sdk 4.5
I used the following code to draw ellipse/rect/line
var circleHolder:UIComponent = new UIComponent ();
circleHolder.graphics.lineStyle(1, 0x000000);
circleHolder.graphics.beginFill(0xffffff);
circleHolder.graphics.drawEllipse(0,0, objectHeight, objectHeight);
Similar for line and rectangle.
Now I am trying to add UITransformTool to this component. For that I did:
var transform:UITransformTool = new UITransformTool();
addElement(transform);
transform.target = circleHolder;
Successfully added the transformation tool to the graphic. Rotation is working perfect. But scaling is not working.
When I try increase or decrease the size of graphic, transformationTool grows bigger or shrinks smaller but no effect on the graphics.
There are two types of resizing: scaling (using UIScaleConnector) or changing width and height properties (your case, using UIConnector). You need to create custom component extending UIComponent and draw grapchics in function updateDisplayList(unscaledWidth:Number,unscaledHeight:Number)
Deletethat will update grapchics when size is changed.
thnx buddy
ReplyDeleteyou did great work...
can you pls tell me did you handle shift and ctrl keys working?
Yep, in tool skin you have corresponding states and you can specify special action when shift or ctrl is pressed, see my post about skinning at http://vstyran-flex.blogspot.com/2012/02/transform-tool-skinning.html
DeleteSir I have made a dynamic ellipse by clicking on a button.Now I want to use UITransform tool for resizing of ellipse.How should I do it?Tell me with proper code.
Deletehow to use transform tool on dynamically adding shapes
ReplyDeleteam using
ReplyDeletevar transform:UITransformTool = new UITransformTool();
addElement(transform);
transform.target = circleHolder;
but tranfor m tool coordinates not in match with grahics coordinate
Hi Volodymyr, i use your's transform component. i place UITransformTool into BorderContainer spark have width,height small (20px,20px) then i zoom BorderContainer multi 30 times. after i add smaill Image to BorderContainer. but when i select image to transform but icon very large, You can help me to solve this problem?
ReplyDelete