Share Posted December 1, 2010 Hi, I'm using a complex class(like a component) as a target object for transform manager, is that anywhere to let TM to change it's size with setSize method rather than change on width and height directly? Thanks. Link to comment Share on other sites More sharing options...
Author Share Posted December 1, 2010 Or is it some place in your code I can change to make call my own methods rather than width/height/rotation/x/y ? Link to comment Share on other sites More sharing options...
Share Posted December 1, 2010 Sure, it's in TransformItem's scaleRotated() method, where these lines are: _targetObject.width = w; _targetObject.height = h; Link to comment Share on other sites More sharing options...
Author Share Posted December 2, 2010 great! thanks. Link to comment Share on other sites More sharing options...
Share Posted July 3, 2012 Hi How can the crop size can be set same way ? Link to comment Share on other sites More sharing options...
Share Posted July 4, 2012 That functionality isn't currently supported, but you could edit the Crop class so that it targets a generic Sprite instance that is exactly the same size (natively) as your target image and then use it as a proxy of sorts so that whenever that Sprite gets moved/resized/rotated, you figure out its width and height and then feed it into your object's special function(s) like setSize(). Link to comment Share on other sites More sharing options...
Share Posted July 9, 2012 Thanks for your input ! I did edited Crop.as, adding public var cropWidth:Number public var cropHeight:Number and edited protected function _calibrateBox():void { var bounds:Rectangle = _target.getBounds(_target); var g:Graphics = _mask.graphics; g.clear(); g.beginFill(0xFF0000, 1); g.drawRect(bounds.x, bounds.y, cropWidth, cropHeight); g = this.graphics; g.clear(); g.beginFill(_fillColor, 1); g.drawRect(bounds.x, bounds.y, cropWidth, cropHeight); trace("_calibrateBox") } A bit of a hack since its work in progress but that works so far 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