Copy link to clipboard
Copied
Hey all,
Looking for help on aligning two seperate text layers, both of which will be dynamic based on mograph input, to my comp's center. In others words, I want to the two layers to be centered no matter what is typed in fields. Any suggestions on building an expresion or script that could help me solve this?
I figured it out. If you're interested.
I centered the first text layer
Used sourceRectatTime to determine its width,
Offset the x position of the second text layer by one half of the first text layer's width
Parented both layers to a null object, centered in the comp
Offset the x position of the null by minus half the width of the second text layer (again using sourceRectatTime)
That seems to have solved my problem.
Copy link to clipboard
Copied
I figured it out. If you're interested.
I centered the first text layer
Used sourceRectatTime to determine its width,
Offset the x position of the second text layer by one half of the first text layer's width
Parented both layers to a null object, centered in the comp
Offset the x position of the null by minus half the width of the second text layer (again using sourceRectatTime)
That seems to have solved my problem.
Copy link to clipboard
Copied
Glad to hear that you worked it out. Thanks for updating the thread.
Feel free to reach out if there are any other questions.
Thanks,
Nishu
Copy link to clipboard
Copied
Hey - I'm trying to build a similar setup, but I'm new to expressions. Would you be able to explain a little further or perhaps share the code you used? Please and thank you!