Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Typewriter with blinking Cursor/ disable Cursor

  • Typewriter with blinking Cursor/ disable Cursor

    Posted by Andrés Watzal on August 16, 2018 at 9:28 am

    Hello,

    I have this Code which gives me kinda a typewriter effect with a blinking cursor.

    3 Slider Controls named: “Speed” // Speed of Typewriter “Start At” // Starting Point and “Blink Speed” // well the speed of the blinking are necessary. With Values like 25, 3, 5 I got a nice working effect.

    CursorType = "_" // cursor type

    F = Math.round(time*effect("Blink Speed")("Slider") % 1); // Blink Speed
    L = text.sourceText.length;
    T = time*effect("Speed")("Slider") - effect("Start At")("Slider")*effect("Speed")("Slider");

    if(F ==1 | (T0) ){Fl=CursorType;}else{Fl=" ";}

    substr(0,T) + Fl

    I used a few tutorials to copy this togheter and get it working. Now I want to remove the cursor at the end.

    So I want it to Blink a few times in the beginning. Then type the word or sentence and not blink during this(as its already doing) and at the end the cursor and blinking is gone. I though about somehow reading out the current letter its at through index and then compare it to the text lenght ?? If possible without using any range selector.

    But I don’t know how I would add this. Is there also a possibility to get a Checkbox that allows me to switch the cursor at the end on and off.

    Thanks in advance
    Andrés

    Guido Giardino replied 7 years, 1 month ago 4 Members · 8 Replies
  • 8 Replies
  • Andrés Watzal

    August 17, 2018 at 6:22 am

    This is acutaly the code. It erased the “<” “>” before.

    CursorType = "_" // cursor type

    F = Math.round(time*effect("Blink Speed")("Slider") % 1); // Blink Speed
    L = text.sourceText.length;
    T = time*effect("Speed")("Slider") - effect("Start At")("Slider")*effect("Speed")("Slider");

    if(F ==1 | (T

    Andrés

  • Kalleheikki Kannisto

    August 18, 2018 at 9:10 am

    Try this


    X = text.sourceText;
    F = Math.round(time*effect("Blink Speed")("Slider") % 1);
    L = X.length;
    T = time*effect("Speed")("Slider") - effect("Start At")("Slider")*effect("Speed")("Slider");

    Cursor = " ";
    if (F==1 | T>0) Cursor = "_";
    if (T>=L) Cursor = " ";
    if (T>0) X.substr(0,T) + Cursor
    else Cursor

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Andrés Watzal

    August 18, 2018 at 9:21 am

    Works perfect. Exactly how I wanted it.

    Thanks a lot!
    Andrés

  • Guido Giardino

    August 18, 2018 at 6:24 pm

    Hi Kalleheikki!

    Your expression works perfectly!

    Is there a way to make the typewriting goes backwards like erasing the letters after a certain time??

    Hope you can help me!

    Best regards!

  • Kalleheikki Kannisto

    August 19, 2018 at 4:55 pm

    The simplest way would be to replace “time” with a slider that you can move forward and back so as to make time go backwards.

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Nawaz Alamgir

    August 21, 2018 at 4:02 pm

    Hi

    if i wanted the cursor to blink once the type out animation has finished, how can i get that do work?

  • Kalleheikki Kannisto

    August 22, 2018 at 10:47 am

    Use the original expression.

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Guido Giardino

    April 9, 2019 at 3:09 pm

    Hi Kalleheikki!

    Just to say thanks for your reply! I just have the same question than the time I asked and I just read your reply! It works great!

    Best Regards!

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