Jump to content
Search Community

Control where transform handles appear

wblair8689 test
Moderator Tag

Recommended Posts

I have a sprite that is masked. I have added the children of that sprite to the transformManger. All works well except I want the handle of the transformManager to appear outside of the mask. Is there a way of doing this? can I add the handles to another displayObject somehow?

 

In looking at the code for TransformManager it looks like there is a member variable - _parent - that targets where the handles are drawn. I guess I could tweak _parent and make it refer to the DisplayObject that I want the handles to appear in. ??

Link to comment
Share on other sites

  • 2 weeks later...

I see why all the items have to be children of the same displayObject but why do the handles? In this project I'm not using multiple selection - so it wouldn't matter anyway. I was looking through the code and I couldn't find where the handles are added. Could you point to where that happens and maybe I could tweak it?

 

Pretty damn cool code by the way.

 

It took me a while to figure out that the TransformEvent.SELECT events are fired by the transformItem not the transformManager. Maybe you should add that to the comments at the top of transformManager?

Link to comment
Share on other sites

Handle-related code is mostly in initSelection(), createHandle(), and redrawHandles().

 

As for the reason why the selection box/handles need to have the same parent, it has to do with them tracing the _dummyBox exactly which I suppose could be accomplished using localToGlobal() and globalToLocal() on each point, but I was trying to avoid that for performance reasons. Technically I believe it would be possible to have the selection box/handles appear elsewhere.

 

Glad you're likin' the code :)

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.
×
×
  • Create New...