-
Expression for text following text in height
Hi , I am new to expression and building a 4 line text graphic .
Message 1
Show Line 1
Show Line 2
Tx 1
I have show line 1 and 2 currently attached to a null with a scaling expression in the null that resizes the size of text depending on how many character are put in and calcualting its width in the safe area. (script below)
My issue is i want to have tx 1 and message 1 follow Show line 1 and show line 2, but without scaling . How can i get these layers to follow show line 1 and 2?
//this expression is applied to the Scale Property of a NULL object controlling multiple text layers
var title_safe = 1250; //width of the title safe area in pixels
var width_array =[] // create an array to hold the widths of all text layers
width_array.push(thisComp.layer(“Show 1 Title Line 1”).sourceRectAtTime().width); //add the width of each text layer to the array
var width_array =[] // create an array to hold the widths of all text layers
width_array.push(thisComp.layer(“Show 1 Title Line 2”).sourceRectAtTime().width); //add the width of each text layer to the array
// … add as many layers as required
var max_width = Math.max.apply(this,width_array); // find the longest the line of text
var maxsize = Math.min(title_safe/max_width*100,100) //calculate a scaling factor based on the longest line and title safe width
var result = [maxsize,maxsize]; //write result array of scaling factors of x and y
thisProperty = result; // this line sets the scale [x,y] with the result array