0

Using After Effects, I am trying to do a countdown of 5 minutes with a setup like this: 5m 00s, 4m 59s, 4m 58s... I have the countdown already set up with Slider Control. However, I'm trying to use a mask for each character separately, which I also mostly have under control, except I realized that the text moves when the width of the text box changes as the text changes, for example, 2m 00s vs 1m 59s because of the width of the character "1" is smaller than "2" in the font I am using. Is there a way I can make the text box width, specifically each character's placement, not change even while Slider is in use? I have already gotten started on creating changes to the mask each time it changes, but I have a feeling it will be a lot of work.

1 Answer 1

0

Option 1 - use a fixed width font, and make sure the text layer you create is left aligned. You'll need to select the text in your layer before you switch the paragraph to left alignment.

Option 2 - Do something like this (I'm sure there's a nicer way to do it), but from looking at this script for countdown timers, and this script for finding the right character, I hacked up this:

Make a text layer for each character.

Make sure each text layer is left aligned.

Put this in the source text expression of each character you want to control:

st = 300;  
t = st - time;  
c = timeToTimecode(t);  
c = c.substring(4,8)
output = c.charAt(3);
output

Change the “charAt” variable for each position. Eg 0 is the furthest right character, and (3) would be the furthest left character (the minute).

grab

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.