Share Posted April 15, 2011 I need to change the origin point that scaling is done by but the origin property doesn't seem to work. Here's the code. var transformManager:TransformManager = new TransformManager({constrainScale: true}); var item:Sprite = new Sprite(); item.graphics.beginFill(0xFF00FF,1); item.graphics.drawRect(0,0,100,100); addChild(item); var transformItem:TransformItem = transformManager.addItem(item); transformItem.origin = new Point(item.width/2,item.height/2); If I drag a corner it should resize and position itself so that the registration point stays in the same point, not that the corner that I am dragging is pulled out. I saw another post here about it not working and someone tweening to the location they need. Is this really the only work around? Is it that origin doesn't work or am I trying to use origin as something that it is not? Is there another way to fix this issue. Link to comment Share on other sites More sharing options...
Author Share Posted April 15, 2011 Update, I tried the method that is described here. viewtopic.php?f=3&t=2701&p=10255&hilit=origin#p10255 You don't need the tween at all, you can just position the object where you want it but this doesn't solve the issue at all because the TransformManager doesn't follow along with the changed size. To get around this I tried calling updateSelection() but this messes up everything, I don't think this method was ment to be called while scaling. Has anyone found another way to handle this? Link to comment Share on other sites More sharing options...
Share Posted April 16, 2011 Yeah, sorry but custom origin points aren't supported. That TransformItem method is used by TransformManager to calibrate things when you click on various handles or set scaleFromCenter to true. Link to comment Share on other sites More sharing options...
Author Share Posted April 18, 2011 I wrote a method to fix this case, can I post it here or do you want an email? Link to comment Share on other sites More sharing options...
Share Posted April 18, 2011 Sure, an e-mail would be great. Link to comment Share on other sites More sharing options...
Share Posted May 4, 2011 I would really need this function aswell, kind of why I bought the Transform Manager in the first place , thought that "Origin" would be the solution, but unfortunatly not. I aswell need to set a Point on the TransformItem, from which it'll rotate / scale. Please post any solutions for this, and I'll be dancing in joy! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now