Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Automatically center a layer

  • Automatically center a layer

    Posted by Mike Brassee on August 12, 2020 at 10:29 am

    Hello,

    I’ve made a countdown timer in after effects.
    But because the with of the numbers isn’t the same across them all, the countdown changes length.
    Thus it looks like the countdown isn’t centered anymore.
    Is there a way to automatically center the countdown during it’s run?

    Mike Brassee replied 6 years, 1 month ago 2 Members · 4 Replies
  • 4 Replies
  • Walter Soyka

    August 12, 2020 at 7:43 pm

    There are a few different ways to make a countdown. Which technique did you use?

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive   |   RenderBreak [blog]   |   Profile [LinkedIn]

  • Mike Brassee

    August 13, 2020 at 7:51 am

    I’ve used the following code:

    rateOfSpeed=1;
    clockStartTime = thisComp.layer("Timer Duration").effect("Slider Control")("Slider")*60;

    clockTimeNumber = Math.floor(clockStartTime - rateOfSpeed*time);

    function addZero(n) {
    return (n < 10) ? "0" + n : n;
    }

    minutes = Math.floor(clockTimeNumber/60);
    seconds = clockTimeNumber%60;

    if (clockStartTime > 0 && time < clockStartTime) {
    addZero(minutes) + ":" + addZero(seconds);
    } else {
    "00:00";
    }

    The problem however, is that my font doesn’t have the same with for all the characters.
    Therefor the countdown goes off center when counting down.

  • Walter Soyka

    August 13, 2020 at 1:12 pm

    Of course, you can use a mono-spaced font.

    If that won’t work for your design, I’d suggest using Numbers effect. Set it to Timecode, untick the “Proportional spacing” option, time-reverse the layer it to make it count down instead of count up, and mask off what you don’t need.

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive   |   RenderBreak [blog]   |   Profile [LinkedIn]

  • Mike Brassee

    August 17, 2020 at 7:35 am

    Hi Walter,

    This worked great!
    Thanks!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy