Copy link to clipboard
Copied
Hey guys,
I'm looking for an expression (preferably) to change the width of a plain ol' black rectangular box that's sitting beneath a layer of text. The text layer is going to change length, and I therefore need the black box to adjust with the text and change length accordingly. I'm sure there's a simple way to do this, but I've been fighting a cold all week and my brain is a little fried.
Any suggestions?
There's a (relatively new) expression function that does exactly this: "sourceRectAtTime"
SourceRectAtTime() Expression- Adobe After Effects tutorial - YouTube
Copy link to clipboard
Copied
There's a (relatively new) expression function that does exactly this: "sourceRectAtTime"
SourceRectAtTime() Expression- Adobe After Effects tutorial - YouTube
Copy link to clipboard
Copied
Hi Kyle,
Thanks! Your link was helpful. This is what I ended up with:
theTextLayer = thisComp.layer("TEXT");
p = 50;
box = theTextLayer.sourceRectAtTime(time);
x = box.width + (p*2);
y = 150;
[x,y]