-
Combine expressions for position and anchor point with text animator
Hi,
I have a paragraph text connected to a .json-file for its value.
Let’s say I want the text to be centered in the composition, so I enter this position expression.
[thisComp.width/2, thisComp.height/2]The source text from the .json-file can differ in length so to make sure that the text remains centered no matter what is inputted I use this expression on the anchor point.
boxTop = this.sourceRectAtTime().top;
boxHeight = this.sourceRectAtTime().height;
boxLeft = this.sourceRectAtTime().left;
boxWidth = this.sourceRectAtTime().width;
h = boxTop + boxHeight/2;
w = boxLeft + boxWidth/2;
[w, h];This works just as intended. But if I want to add an animator for the position – let’s say to animate each line one by one up 20 pixels – this doesn’t work because I’ve locked the anchor point with the expression above. If I remove this expression the animator works just fine. But then I can’t make sure that the text remains centered.
My questions regarding this are:
1) Is there a smarter/better way to make sure the text stays centered than using the combination of expressions above?
2) If not, is there a way to combine the animator for the text and still make sure the text stays centered in the composition?Best regards,
/C