ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Position of a text layer is dependent on decimal/size of another text layer

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Christian Simpson
Position of a text layer is dependent on decimal/size of another text layer
on Feb 26, 2018 at 11:48:00 pm

So I have attached a slider to control a specific text layer but I was wondering how I can make the position of another text layer be affected based on how large or how many decimal places the original text layer is. To put it simply I would like the 2nd text layer to always have the same amount of space from the 1st text layer.

As in the example I would simply like the word Views to butt up against the number with the same space no matter how large the number gets.



Return to posts index

Andrei Popa
Re: Position of a text layer is dependent on decimal/size of another text layer
on Feb 28, 2018 at 1:04:04 pm

numberPosition = thisComp.layer("number").transform.position;
distance = thisComp.layer("Null 1").effect("Slider Control")("Slider");
tempY = numberPosition[1];
tempX = numberPosition[0]+distance+thisComp.layer("number").sourceRectAtTime(time,false).width;
[tempX,tempY]


The first 2 variables should be "pick-whipped". First is the position of your counter layer and second is the distance you want to aquire. Both layers should be left aligned.
Another way would be to mjust make one solo layer. If you have an expression for your number, you should add " views" to its value. Something like
value + " views";

Andrei
My Envato portfolio.


Return to posts index

Christian Simpson
Re: Position of a text layer is dependent on decimal/size of another text layer
on Feb 28, 2018 at 2:32:17 pm

Thank you very much Andrei!


Return to posts index

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