Participating Frequently
October 17, 2023
Answered
Text Track expression
- October 17, 2023
- 2 replies
- 1193 views


I'm not sure if someone has already posted this issue, but I have the following situation: I have two text layers, text 1 and text 2. Text 1 will have the number of days, and text 2 only says 'days ago.' I want to use an expression so that as the number increases, it shifts to the left and doesn't overlap. In this example, I'm changing the values from a SourceText in Essentials Graphics.

So, I used this expression, and it creates the desired shift, but the issue is that it animates the shift. I want the shift to occur directly from the SourceText in Essentials Graphics, and I want to be able to adjust the shift because I'll make it very large.
// Get the width of the text
w = thisLayer.sourceRectAtTime().width;
// Get the value from the source text
t = parseInt(thisLayer.text.sourceText);
// Define initial and final values for the number
start = 0;
end = 1;
// Define a duration for the animation in seconds
duration = 2;
// Calculate the text offset based on time
offset = linear(time, 0, duration, start * w, end * w);
// Return the original position minus the offset
value - [offset, 0];the video of the expression running
