Jump to content
Search Community

Get y/x values relative to the stage

Jannik test
Moderator Tag

Recommended Posts

Hi all.

 

Working in Adobe Animate with GSAP.

 

For a project, I have created a circle as a movieclip ("disk1"). Within "disk1", I have 2 dots called "area1" and "area2". "Disk1" is rotating.

 

What I want, is to get the changing x and y values of "area1" and "area2" - but I'm only able to get the values from within "area1" and "area2" themselves, so the value is static and doesn't change when disk is spinning.

 

Anyone have a solution for this - how can I get the x and y values relative to the stage?

 

Thanks!

Skærmbillede 2024-02-11 kl. 09.14.14.png

Link to comment
Share on other sites

Hi @Jannik welcome to the forum!

 

Maybe https://gsap.com/docs/v3/Plugins/MotionPathPlugin/static.convertCoordinates() can help, but hard to say without a minimal demo. Also can you explain the problem you're trying to solve instead of the solution you're thinking of? Please also include a demo of your current setup so that we can dive directly in to the code. Hope it helps and happy tweening! 

 

See the Pen aYYOdN by GreenSock (@GreenSock) on CodePen

  • Like 1
Link to comment
Share on other sites

I suspect the MotionPathPlugin.convertCoordinates() won't work because that's for DOM elements whereas if I remember correctly, Adobe Animate uses <canvas> (well, EaselJS which is <canvas>-based), right? This isn't really a GSAP question - I think you'll need to seek out that answer from the Adobe community because it's about their tooling. Please do let us know if you find an answer, though. 

Link to comment
Share on other sites

On 2/11/2024 at 11:03 AM, mvaneijgen said:

Thanks for getting back. I understand that this might not be the right forum. Sorry for taking your time.

 

Hi @Jannik welcome to the forum!

 

Maybe https://gsap.com/docs/v3/Plugins/MotionPathPlugin/static.convertCoordinates() can help, but hard to say without a minimal demo. Also can you explain the problem you're trying to solve instead of the solution you're thinking of? Please also include a demo of your current setup so that we can dive directly in to the code. Hope it helps and happy tweening! 

 

 

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