Autoscale Text + Dynamic position
- January 25, 2022
- 1 reply
- 180 views
Hi !
I use several expressions of Dan Ebberts to have an autoscale text:
Anchor point :
sourceSize = thisLayer.sourceRectAtTime(time, false);
T = sourceSize.top;
L = sourceSize.left;
W = sourceSize.width;
H = sourceSize.height;
([L+ W/2,T+H/2])
Size :
maxW = thisComp.width*0.9;
maxH = thisComp.height*0.45;
r = sourceRectAtTime(time);
w = r.width;
h = r.height;
s = w/h > maxW/maxH ? maxW/w : maxH/h;
[100,100]*s
It works great, the problem is that I have several text layers and I would like the position of the layer below to move according to the height of the text above. They must not overlap and move keeping the same distance between them.
I tried using the following expression on the position of my bottom layer:
st = thisComp.layer("P1");
sh = st.sourceRectAtTime().height;
tp = st.position;
np = [value[0], tp[1] + sh]
Unfortunately, as the top layer has a scale that varies due to autoscale, the position is not well calculated.
How could I solve my problem?
Thank you in advance for your help.
