Skip to main content
Inspiring
May 29, 2023
Answered

Change position of each line of text with expression

  • May 29, 2023
  • 1 reply
  • 2479 views

I'm working with a client that has updated it's brand guidelines and for social content and ads with shorter text blocks they are offsetting the text - on each row in a text block individually - on the x axle.

Row 1 is - 50 px from the centre, row 2 is + 55 px, row 3 is - 85 px and so on.

I have until now just split the text into one layer per row and moved them to a nice layout.

It works but is a pain in the a** when you have to do changes or translation.

So is there a way - with expressions and/or text animatior/range selector - to keep the multi line text block "intact/live" without splitting it into layers but control the position of each row?

Need to be able to do line breaks and scale the text box from shot to shot.

Would be golden if I could attatch the position of each row to a slider control. 

This topic has been closed for replies.
Correct answer Adam24585301qycn

Unfortunately, you will have to create a text layer for each row of text if you want to achieve pixel-perfect left edges.


1st text layer for line 1 only

txt = thisComp.layer("Master Text Layer").text.sourceText.split("\r");
n = 1;
if (txt.length >= n)
txt[n-1]
else
""

for 2nd line

txt = thisComp.layer("Master Text Layer").text.sourceText.split("\r");
n = 2;
if (txt.length >= n)
txt[n-1]
else
""

 for 3rd line

txt = thisComp.layer("Master Text Layer").text.sourceText.split("\r");
n = 3;
if (txt.length >= n)
txt[n-1]
else
""

1 reply

Community Expert
May 29, 2023

I suggest you start working with the Extended Graphics Panel and use three text layers. If your content can be edited in Premiere Pro, you can create a MOGRT that allows you to do all of the text editing in Premiere Pro's Graphics workspace, saving you a lot of time. 

 

I have created a single MOGRT that contains a dropdown menu to select all social media frame sizes, repositions each layer, adjusts the color of the text based on the background footage, lets me control the speed of the animation and the duration of the graphic, all inside Premiere Pro. The renders are faster, and the work is faster. 

 

There is no way to control the position of a second line of text with pixel accuracy using expressions. Even if you stick with Extended Graphics, editing your content in that workspace will be faster than in a regular comp.

 

Here's a screenshot of one of my Extended Graphics comps that sets up a lower third graphic for multiple social media formats as well as HD and 4K videos for YouTube and Vimeo.

Here's a link to a fairly decent Extended Graphics course.

Inspiring
May 29, 2023

Hi

Thanks.

The next step is absolutely to have it working as a mogrt.

I've created a lot of mogrt:s that I've split the text to different layers to be able to use different font weights and sizes for each row but then you have to split the text and also have several textboxes in Premiere

What I want to achieve is to have one block of text that each row can be offset on the x axle.

Attaching an image so it's a bit clearer what i'm after.

Inspiring
May 29, 2023

you could have your text on 1 layer with hard returns between each line of text. then you could have 3 other text layers each one using an expression to take only line1, and line 2 and line 3 respectively. from there you can have individual control of those. Is that what you want ?


To have a hidden parent layer where I change the text and the it reflects to the 3 other layers?

Absolutly. That could work!

Do you know a expression that could solve that?