ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Resize one side of a box (lower third) to text

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Ella Turner
Resize one side of a box (lower third) to text
on Sep 27, 2018 at 4:58:04 pm

I'm trying to get a lower third to re-scale according to the text I'm typing in - but I only want the right side of the box to re-size.
I'm using code on the 'size' of the rectangle path of my shape layer at the moment - do I need to play around with the position too?

The code below is the one I've been using when I need both sides to adapt.

Thanks

margin = 23;
text_width = thisComp.layer("Text 2").sourceRectAtTime().width;
text_height = thisComp.layer("Text 2").sourceRectAtTime().height;
box_width = text_width + margin*14;
box_height = text_height + margin*2;
[box_width, box_height]




Return to posts index

Kalleheikki Kannisto
Re: Resize one side of a box (lower third) to text
on Sep 27, 2018 at 7:18:41 pm

Moving the anchor point to the left edge should do it.

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]