Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
atmofunk

Resetting a transform

Recommended Posts

I'm looking for a TransformItem.resetTransform() or something along that lines to take whatever item (or list of them) and set them back to their original x/y, scale, and rotation. I'm surprised there isn't any sort of reset() method included in this package.. unless i've totally missed it.

 

Of course, i could hold on to the original values myself and apply a manual transform when i need it, but hey.. a resetTransform() would be much nicer.

 

cheers

Link to comment
Share on other sites

When you say resetTransform(), do you mean remove any scaling, rotation, and x/y translation whatsoever? If so, that should be as simple as:

myObject.transform.matrix = new Matrix();

 

If the object is selected, just make sure you call the TransformManager's updateSelection() method to make sure the selection box/handles get adjusted.

Link to comment
Share on other sites

ah yes of course -- I should have tried that, and yes that's exactly what I meant. Thanks for the updateSelection() tip as well :)

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.
×