Skip to main content
Inspiring
November 16, 2023
Answered

Align two text layers

  • November 16, 2023
  • 2 replies
  • 621 views

Hi

Im trying to align the left side of a left justified layer ("Left justified text") to a center justified layers left side ("CENTER HEADLINE").

Need the left justified layer to move dynamically if I change the text of the center justified layer so it always align with the left side of the center text.

It´s going to be a Mogrt.

  

This topic has been closed for replies.
Correct answer ShiveringCactus

I think this expression should work:

var CentreTextWidth = thisComp.layer("Centre Text").sourceRectAtTime().width;
var Y = transform.position[1];
var X = thisComp.width/2-CentreTextWidth/2;
[X,Y]

 

 

2 replies

Adam24585301qycn
Inspiring
November 16, 2023

wow, thats amazing, I had been doing it a different way for over a year. so happy to see a better mouse trap. Well done shiveringcactus !!!

ShiveringCactus
Community Expert
ShiveringCactusCommunity ExpertCorrect answer
Community Expert
November 16, 2023

I think this expression should work:

var CentreTextWidth = thisComp.layer("Centre Text").sourceRectAtTime().width;
var Y = transform.position[1];
var X = thisComp.width/2-CentreTextWidth/2;
[X,Y]

 

 

Inspiring
November 16, 2023

Great!!
Exactly what I was looking for!

Thanks!!