Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › linking position of a text layer to the end of another text layer

  • linking position of a text layer to the end of another text layer

    Posted by Hissora Linse on February 19, 2014 at 10:42 am

    Hello,

    Im creating a corporate identity manual for a company and they will use it to just open it and typing whatever they need without worrying about positioning text in the right places as I will set all this previously.

    Im trying to set the position of a text layer (the subtitle layer) based on the end of another text layer (the title layer)
    My title and subtitle layer always have to be 80 px separated from eachother. And there have to be in separate layers because sometimes they will need to write a title and a subtitle and sometimes just a title.

    If the title layer has 3 lines, layer 2 (containing the subtitle) would need to position itself 80px below layer 1 automatically, and so on regardless of how many lines layer 1 has….

    Thank you in advance

    Hissora

    Hissora Linse replied 12 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    February 19, 2014 at 4:18 pm

    I think the best way, if you know the additional space required when a new line is added to the title, would be to set things up for a single-line title and add this to the position of the subtitle:

    lineHeight = 45;
    txt = thisComp.layer(“Title”).text.sourceText;
    numLines = txt.split(“\r”).length;
    value + [0,(numLines-1)*lineHeight]

    Dan

  • Hissora Linse

    February 20, 2014 at 1:03 pm

    Im sorry if I sound an ignorant… its just that Im new to Expression…
    The title layer has text of 93px font size and 96px leading (space between each line)
    The subtitle layer has text of 58px font size and 62px leading

    does this matter (do I have to change anything on the expression you gave me?) or its ok to just put the expression you gave me? and … the expression you gave me has to be put in the position of the subtitle layer right?

    Thank you very much in advance for taking the time to respond.

    Hissora

    Actually Dan... I have figured it out on my own! it works perfectly!!!! thank you so very much!!! This is the first time I use expressions and it's very interesting and exciting how much control you can have ! thanks for you huge knowledge....

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