-
Auto horizontally center lines of dynamic text boxes
I’m trying to find a solution to aligning multiple text box rows horizontally to the center of the comp.
I have a bunch of these I need to create and ideally don’t want to be manually spacing them.I’m using this expression on the position to create equal margins between each box though if text is edited it works from left to right throwing the spacing out.
s = thisComp.layer(“Controller”).effect(“Spacing”)(“Slider”);
prev = thisComp.layer(index – 1);
x = prev.transform.position[0];
y = prev.transform.position[1];
w = prev.sourceRectAtTime().width;
[x + w + s, y]
Each text box also has a position text animator applied so each can move independently without effecting the others.