ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expression to keep anchor point in the bottom center

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
marina martins
Expression to keep anchor point in the bottom center
on Jan 5, 2017 at 3:37:25 pm

Hi everyone,

I'm creating a template that uses 3 layers of text and calculates its combined heights to define the height of a shape. This part I could achieve with a little experimenting.
The position of the text layers 02 and 03 are linked to the position of text layer 01.

The problem is the anchor point of text layers changes its relative position when I change the source text.
Let's say I type "Games" and put the anchor point in the lower bottom. If after that I change the text to "games", the anchor point's position won't be the lower bottom anymore.
I need it to dynamically change accordingly to the text that is typed.

Is there any way to achieve this?

Thank you very much!


Return to posts index

marina martins
Re: Expression to keep anchor point in the bottom center
on Jan 5, 2017 at 4:11:48 pm

I found a solution!

Youtube user "Egg nof" posted this.

It worked very well for me. Hope it helps someone else!

boxTop = this.sourceRectAtTime().top; // Position of top of text box
boxHeight = this.sourceRectAtTime().height; //Height of textbox


//Offset anchor down from boxTop using half the height of the box
[value[0], boxTop + boxHeight/2 ];


Return to posts index

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