ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Center two dynamic text columns in relation to each other

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Niels B Nielsen
Center two dynamic text columns in relation to each other
on Mar 5, 2018 at 10:07:02 am

I have a composition with two dynamic text columns. I want the two columns to be centered in relation to each other. The length of the columns vary accoring to user input.

I'm calculating the length of each text column with sourceRectAtTime, and the total width of the comp is 1920. How do I center each column in relation to each other?


Return to posts index

Niels B Nielsen
Re: Center two dynamic text columns in relation to each other
on Mar 5, 2018 at 7:35:16 pm

Found my solution through trial and error. It helped me to imagine that the horisontal spacing left not used by the width of column 1 and column 2 should be split equal into 3 (space before first column, space between both columns and space after second column).

For reference this is what I did for the X Position.

Column 1 position:
(1920-(c1w+c2w))/3

Column 2 position:
(1920-(c1w+c2w))/3*2 +c1w


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]