ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Move an image left or right next to a text layer which is aligned to the left.

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Chris Tandoh
Move an image left or right next to a text layer which is aligned to the left.
on Mar 30, 2018 at 1:54:27 am

I have a text layer like so [Youtube.com/helphelphelp] and this text is aligned to the right meaning when text letters increases, it would the last letter will always remain at its current position. My problem is that I have an icon on another layer which is positioned at the left but when I increase the letters from [Youtube.com/helphelphelp] to [Youtube.com/helphelphelphelphelphelp], it overlaps onto the image icon. Is there a way to link this image to the text layer so as it expands to the left, the image icon will also move to the left keeping the same distance all the time.


Return to posts index

Andrei Popa
Re: Move an image left or right next to a text layer which is aligned to the left.
on Mar 30, 2018 at 8:02:55 am

You should put this into the position of the icon
textLayer = thisComp.layer("textLayer");//replace it with the name of your text layer
textPosition = textLayer.transform.position;
tempX = textPosition[0]+textLayer.sourceRectAtTime(time,true).left;
[tempX ,value[1]]

If you want to add some distance between the text layer and the icon, just move the anchor point of the icon to the left for the desired amount.

Andrei
My Envato portfolio.


Return to posts index

Chris Tandoh
Re: Move an image left or right next to a text layer which is aligned to the left.
on Mar 30, 2018 at 9:35:21 am

It works perfectly. A big thank you!!


Return to posts index

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