here’s what i do…
make a rectangle or rounded rectangle shape layer (they are actually the same, the rectangle shape layer has an option for rounding, so i’m not sure why there are two).
parent the shape layer to the text that you want it to fit around
then add this expression to the rectangle path>size property:
pad = 10 ; // set pad value
if ( hasParent == true ) {
rect = parent.sourceRectAtTime() ;
w = rect.width + pad * 2 ;
h = rect.height + pad * 2 ;
[ w, h ] ;
} else
value ;
and this expression for rectangle path>position property (not the layer>transform>position property):
if ( hasParent == true ) {
rect = parent.sourceRectAtTime() ;
x = rect.width / 2 + rect.left ;
y = rect.height / 2 + rect.top ;
[ x, y ] ;
} else
value ;
then set the rectangle>transform group>position to 0, 0 (again this is different than the layer>transform>position property)
and you should be good to go, just adjust the pad value in the first expression as needed.
Kevin Camp
Art Director
KCPQ, KZJO & KRCW