ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Typewriter with blinking Cursor/ disable Cursor

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Andrés Watzal
Typewriter with blinking Cursor/ disable Cursor
on Aug 16, 2018 at 9:28:31 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


Return to posts index

Andrés Watzal
Re: Typewriter with blinking Cursor/ disable Cursor
on Aug 17, 2018 at 6:22:49 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<L & T>0) ){Fl=CursorType;}else{Fl=" ";}

substr(0,T) + Fl



Andrés


Return to posts index

Kalleheikki Kannisto
Re: Typewriter with blinking Cursor/ disable Cursor
on Aug 18, 2018 at 9:10:07 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


Return to posts index


Andrés Watzal
Re: Typewriter with blinking Cursor/ disable Cursor
on Aug 18, 2018 at 9:21:06 am

Works perfect. Exactly how I wanted it.

Thanks a lot!
Andrés


Return to posts index

Guido Giardino
Re: Typewriter with blinking Cursor/ disable Cursor
on Aug 18, 2018 at 6:24:41 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!


Return to posts index

Kalleheikki Kannisto
Re: Typewriter with blinking Cursor/ disable Cursor
on Aug 19, 2018 at 4:55:40 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


Return to posts index


Nawaz Alamgir
Re: Typewriter with blinking Cursor/ disable Cursor
on Aug 21, 2018 at 4:02:43 pm

Hi

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


Return to posts index

Kalleheikki Kannisto
Re: Typewriter with blinking Cursor/ disable Cursor
on Aug 22, 2018 at 10:47:54 am

Use the original expression.

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

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