FORUMS: list search recent posts

Automatically wrap variable text with a color boundary box

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
James Ree
Automatically wrap variable text with a color boundary box
on Feb 19, 2013 at 6:29:06 am

Hi Creative Cow,

I'm attempting to add some customised subtitles to a video. I'm using the following expression to link Metadata Speech function produced in Premiere 5.5, and then imported into After Effects.

What I'd like to do is wrap this text in a 80% grey transparent box that varies in x according to the number of words on screen at any one time. The text color I can easily change, but I can't figure out how to highlight the text in a box. Thanks in advance.

James

L = thisComp.layer("name of your video. extension");
max = 5; // number of words to display
n = 0
if (L.marker.numKeys > 0){
n = L.marker.nearestKey(time).index;
if (L.marker.key(n).time > time){
n--;
}
}
s = " ";
if (n > 0){
base = Math.floor((n-1)/max)*max + 1;
for (i = base; i &lt; base + max; i++){
if (i &lt;= L.marker.numKeys){
s += L.marker.key(i).comment + " ";
}
}
}
s


Return to posts index

Stephan Walsch
Re: Automatically wrap variable text with a color boundary box
on Feb 20, 2013 at 11:45:08 pm

hi James,
mega weird "not really a lot of expressions" approach:

-download the awesome (and free) BLOKK Font at blokkfont.com
-create a text layer under your current text, set it to be the blokk font
-change size and color to your liking
-link the text of this layer to your actual text above via expression

this should do what you want
Cheers!

Stephan


Return to posts index

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