Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Position two text boxes side by side with same margin

  • Position two text boxes side by side with same margin

    Posted by Johan Liljeroos on May 29, 2019 at 9:05 am

    Hi,
    I’m trying to make a lower third template in After Effects (preferably an Essential graphics template for Premiere). Name on first row and then Title and Company on second row. Title and Company should have different fonts so I need two different text boxes side by side with constant margin between them. How do I do?

    //Johan

    Tomas Bumbulevičius replied 7 years, 3 months ago 2 Members · 1 Reply
  • 1 Reply
  • Tomas Bumbulevičius

    May 29, 2019 at 12:40 pm

    Hey Johan. There are quite a few scenarios, but in general:

    1. Create a null and add two Sliders, where one will control X padding, and other for Y.
    2. Create two Text layers and two rectangular shape layers.
    3. Inside the shape layers rect size, add expression similar to this, based on your layers/controllers names:

    textLayer = thisComp.layer(1);
    textS = textLayer .transform.scale[0] / 100;
    textW = textLayer .sourceRectAtTime(time,true).width*textS;
    textH = textLayer .sourceRectAtTime(time,true).height*textS;
    boxW = textW+thisComp.layer('control').effect('box-xPadding')('Slider');
    boxH = textH+thisComp.layer('control').effect('box-yPadding')('Slider');
    [boxW, boxH]
    }

    Where textLayer should be your main text layer’s index.
    4. Apply this expression to second shape’s size as well, and change textLayer index to your subtitles one.
    5. You will have to adjust positioning of the layers and their anchor points as well as add another slider to control the gap between them.

    I assume in the forum there is already a fully working solution, so searching could help.

    Find out more:
    After Effects Tutorials: motion design, expressions, scripting.
    Boxer – Dynamic Text Boxes Template with a Live Preview

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