Jump to content
GreenSock

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

convertCoordinates Move Group Elements

Recommended Posts

Hi!

 

I was learning convertCoordinates and getRelativePosition.

I thought I could move group elements together but I could not figure out.

is there any way to move the yellow circles with the blue line?

 

Thank you.

See the Pen ExgqQQB by shunyadezain (@shunyadezain) on CodePen

Link to comment
Share on other sites

Hm, your blue line is growing/stretching/moving, so what exactly would you want the yellow circles to do? In other words "move with the blue line" is rather ambiguous. You could certainly plot their relative position between the blue line's start/end points, and then in an onUpdate set their cx/cy values accordingly so that they move in a relative fashion. 

  • Like 4
Link to comment
Share on other sites

Hi Jack! Thank you for help.

I think I understand them more. I was just thinking of making a robot arm type of animation with convertCoordinates or getRelativePosition for practice and looking for a way to move group elements together on the line.

And I got another idea to do from your advice. I will try it and ask again if I get stuck.

 

Thank you so much!

 

  • Like 1
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.
×