Share Posted January 26, 2021 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 More sharing options...
Share Posted January 27, 2021 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. 4 Link to comment Share on other sites More sharing options...
Author Share Posted January 27, 2021 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! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now