Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › Resize one side of a box (lower third) to text

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

    Posted by Ella Turner on September 27, 2018 at 4:58 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]

    Kalleheikki Kannisto replied 8 years ago 2 Members · 1 Reply
  • 1 Reply
  • Kalleheikki Kannisto

    September 27, 2018 at 7:18 pm

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

    Kalleheikki Kannisto
    Senior Graphic Designer

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy