Jump to content


TransformManager [AS3]: Adding Custom classes /w complex UI

Recommended Posts

HI Jack,

I am getting my hands on your TransformManager class at the moment for evaluating its features. So far, I like it's simplicity when it comes to the API, great job.

I need some input to certain project requirements from the guy who made the classes, so here I am:


We have not just images or other "simple" displayobjects, but more complex UI elements with a border, background, id-box etc (see screenshots). What is the best way to manage these items in your TransformManager ?


So far, i ran some tests with setting "TransformManager.SCALE_WIDTH_AND_HEIGHT" and overwriting the width/height-setters, and it is basically working (although i had an offset when scaling the items big, could be my problem). Another possibility would be to create a proxy class for the transform-property, so I am informed of any changes you make. How would you develop this ?




Link to comment
Share on other sites

Hmmm, could you explain what exactly the problem is with using TransformManager as-is? Why do you need to override width/height properties or transform.matrix, etc.? What isn't working as expected? TransformManager doesn't care if your object has lots of children, complex borders, etc. Ultimately your objects are contained in a DisplayObject, right? Are you trying to make the selection box draw itself around your object in a custom way? Could you post (or e-mail me) a simple example of the problem? Are you using Flash or Flex?

Link to comment
Share on other sites

Hi Jack,

this is not exactly a problem, more a code-design question :)

As you can see in my attachments, I have child-elements that should not be scaled (this #01-box), whereas its background should. This is also what I tryed to say with "complex UI". If you still don't understand me (perhaps I have difficulties saying what I mean as I am from Germany ;) ) I am trying to build some sample-classes together - it's just a bit complicated as it derives from a greater project.


Best wishes


Link to comment
Share on other sites

Okay, I think I understand now - you need to handle things internally in a custom way whenever the object is scaled. So yes, I'd override the width/height/scaleX/scaleY properties AND the transform property so that you accommodate any change that could be made. Just be aware that if you allow multiple selections, items can become skewed, not simply scaled. For example, imagine selecting an object that is rotated 45 degrees and ALSO selecting another object, then scaling the whole selection vertically - the object that was at a 45 degree angle (or any angle really) will become skewed. This is a GOOD thing and is certainly not a bug in the class, it's just the nature of scaling an object at an angle.


I hope that helps.

Link to comment
Share on other sites

Okay so I was on the right track :) I ran some tests with allowing the TransformManager to alter the transform.matrix-property, but found it really difficult to apply these changes properly to my custom UI. For now, sticking to TransformManager.SCALE_WIDTH_AND_HEIGHT seems the best solution. Thanks again!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.