FORUMS: list search recent posts

Scale background to text

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Gary DeVaan
Scale background to text
on Nov 10, 2016 at 10:42:05 pm

I'm using the first block of code to scale my background to a line of text, but I would like to also add a TITLE text layer. Can I use something like on the bottomto say either of the layers whatever is longest to determine the background size?

x = thisComp.layer("NAME").sourceRectAtTime().width+150;
y = value[1];
[x,y]

------------------------------------

x = thisComp.layer("NAME" || "TITLE").sourceRectAtTime().width+150;
y = value[1];
[x,y]


Return to posts index

Kevin Camp
Re: Scale background to text
on Nov 10, 2016 at 11:17:33 pm

try this:

w1 = thisComp.layer("NAME").sourceRectAtTime().width;
w2 = thisComp.layer("TITLE").sourceRectAtTime().width;
x = Math.max(w1,w2)+150;
y = value[1];
[x,y]

Kevin Camp
Art Director
KCPQ, KZJO & KRCW


Return to posts index

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