Jump to content
GreenSock

erikb

finding projected screen coordinates of transformed element

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Apologies for this being somewhat off topic.  Is there a suggested way to use greensock to find the projected screen coordinates of elements that have been tweened by transforms (as indicated by the values in their _gsTransform)?

 

StackExchange has a suggestion and some code.  Wondering if there was a built in solution I have overlooked before going down this path.  Thanks.

 

 

 

Link to comment
Share on other sites

If you need something a little more robust so that you can convert between local and global points and find a precise spot in either context, let me know because we do have an upcoming tool that's in beta right now for "Shockingly Green" and "Business Green" Club GreenSock members, available by request.

 

Example: if you've got a rotated element nested inside a scaled element inside a skewed element (or whatever), and you want to animate something deep inside there to wherever the user clicks - this can do it for you. 

  • Like 3
Link to comment
Share on other sites

That's great news about the upcoming library/utility.  

 

You greensocks are prescient.

 

For my purposes, for this project, getBoundingClientRect did the trick.  

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