-
Dynamic Type Maintaining Distances
Hi all,
Really appreciate help on this, just not getting it!
I have 2 text layers: Headline and Body. The Headline text functions as intended, every new line re-centers the text layer and layer dynamically scale based on text length.
The body copy is set to maintain the same distance from the Headline as more lines are added. This bit works, but as it scales the math breaks and it loses the correct distance over time.
Have posted a project file here https://gofile.io/d/Z7reIE
Code also below but probably a little confusing.:
HEADLINE POSITION:box = thisLayer.sourceRectAtTime(time);
offset = box.height/2;
y = position[1] - offset;
x = value[0];
[x, y];HEADLINE SCALE:
textwidth = thisLayer.sourceRectAtTime().width;
s = Math.min(100*900/textwidth, 100);
[s,s]BODY POSITION:
box = thisComp.layer("HEADLINE_01").sourceRectAtTime(time);
offset = box.height/2;
y = position[1] + offset;
x = value[0];
[x, y];BODY NUL:
thisComp.layer("HEADLINE_01").transform.scale[0]