Automatically update location of an object when another object changes
Hi there,
I am trying to see if there is a way to “link” the position for two objects. For example, let’s say I have one text that I can edit. I have another text which I want to place it certain pixel away from the previous text and I want to maintain that distance when the previous text is edited automatically.
Let’s say i have one text box at location (10,10) with length of 5. The text should always be 15px to the right, and 2 pixels up, so in this case, it should be at location (10+5+15, 10 - 2) = (30, 8).
Now, if the first text changes and the length increased to 10, and vertically moved down 13px, then the other textbox should automatically be readjusted to (10+10+15, 10 + 13 - 2) = (35, 21).
I know I can manually update them, but I might have a lot of it and manually updating them could be tedious or prone to error or might have something more complex than just two texts.
My question is that is there a way to “link” these objects’ positions such that if one changes, the other will automatically change too? I tried to search online but didn’t see anything exactly addresses this issue. Let me know if more complicated example would help explaining the issue.
Thanks in advance.
