AE Expression for moving lines of text on Y , if layer below is on a scale expression
I have 4 lines of text
Message 1 (which never changes font size)
Line 1
Line 2
Message 2 (which never changes font size)
I want message one and message 2 to always follow up or down on the y axis, Line 1 or 2.
I have line 1 and 2 attached to a null object which has the following expression to control the scale of these text layers if going over a certain area if more characters are used.
//this expression is applied to the Scale Property of a NULL object controlling multiple text layers
var title_safe = 1200; //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
// ... 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
My Prob is i want to attach message one and message two to the same null so it will follow line 2 and two, but i dont want them to scale (as i want them to stay the same size) I have tried the following expression
s = [];
parentScale = parent.transform.scale.value;
for (i = 0; i < parentScale.length; i++){
s[i] = (parentScale[i]== 0) ? 0 : value[i]*100/parentScale[i];
}
s
however this doesnt seem to solve my issue with keeping message 1 and two close to text line 1 and 2 either. I feel i need an expression on the posisitons of message 1 and two that will always follow line 1 and 2 without classing with them due to their scale values , any input anyone?
